/* City-only information header and compact harbor ship cards. */
#app:has(>.world-main.view-city)>.topbar{position:absolute;inset:0 0 auto;z-index:20;width:100%;height:85px;min-height:85px;padding:7px 18px;gap:clamp(8px,1vw,16px);flex-wrap:nowrap;overflow:hidden}
#app:has(>.world-main.view-city)>.topbar>.brand{flex:0 0 190px;min-width:0;margin:0}
#app:has(>.world-main.view-city)>.topbar .brand-logo{display:block;width:184px;height:auto;max-height:68px;object-fit:contain;object-position:left center}
#app:has(>.world-main.view-city)>.topbar .city-header-context{height:68px;min-height:0;max-height:68px;grid-template-columns:minmax(100px,.85fr) minmax(0,1fr) minmax(0,1fr);gap:8px;padding:5px 9px;overflow:hidden}
#app:has(>.world-main.view-city)>.topbar .city-header-goods>div{gap:2px 7px}
#app:has(>.world-main.view-city)>.topbar .city-header-good{font-size:10px}
#app:has(>.world-main.view-city)>.topbar .city-header-good img{width:18px;height:18px}
#app>.topbar:has(>.city-header-context){gap:clamp(8px,1vw,18px);flex-wrap:nowrap}
#app>.topbar:has(>.city-header-context)>.brand{flex:0 0 auto;margin-right:0}
.city-header-context{display:grid;grid-template-columns:minmax(118px,.9fr) minmax(116px,1fr) minmax(112px,1fr);align-items:center;gap:clamp(8px,1vw,16px);flex:1 1 420px;min-width:0;padding:9px 12px;border:1px solid rgba(137,105,54,.24);border-radius:9px;background:linear-gradient(115deg,#faf3df,#fffdf5 48%,#f6edda);box-shadow:0 3px 10px rgba(59,47,29,.1),inset 0 0 0 2px rgba(255,255,255,.38)}
.city-header-context>*{min-width:0}
.city-header-identity{display:grid;gap:3px;align-content:center}
.city-header-context .eyebrow{font-size:9px;letter-spacing:1.2px;color:#85704c}
.city-header-name{overflow:hidden;color:#193f42;font:600 clamp(15px,1.25vw,21px)/1.05 Georgia,serif;text-overflow:ellipsis;white-space:nowrap}
.city-header-nation{display:flex;align-items:center;gap:6px;font:14px/1.1 Georgia,serif;color:#294a48}
.city-header-nation img{width:30px;height:20px;object-fit:contain;filter:drop-shadow(0 1px 1px rgba(29,44,40,.2))}
.city-header-identity>small{font-size:11px;color:#566c64}
.city-header-goods{display:grid;gap:6px;align-content:center;min-width:0;padding-left:10px;border-left:1px solid rgba(137,105,54,.25)}
.city-header-goods>div{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px;min-width:0}
.city-header-good{display:inline-flex;align-items:center;gap:4px;min-width:0;color:#314b46;font-size:11px;white-space:nowrap}
.city-header-good img{width:22px;height:22px;object-fit:contain;filter:drop-shadow(0 1px 1px rgba(30,43,38,.15))}
.view-city .city-heading{display:none}
.city-dock{left:4%;right:4%;justify-content:flex-start;align-items:flex-end;gap:12px;max-width:1100px;max-height:45%;overflow-x:auto;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(235,222,187,.8) transparent}
.dock-ship.city-ship-card{display:grid;grid-template-rows:80px auto auto 42px;gap:7px;flex:0 0 246px;width:246px;min-width:220px;padding:9px 11px 10px;text-align:left;border:1px solid #c1a66d;border-radius:10px;background:linear-gradient(145deg,rgba(255,251,235,.97),rgba(238,224,190,.96));box-shadow:0 6px 18px rgba(13,39,42,.4),inset 0 0 0 3px rgba(255,255,255,.44);backdrop-filter:blur(3px)}
.dock-ship.city-ship-card.active{border:2px solid #b3873e;box-shadow:0 7px 20px rgba(13,39,42,.46),inset 0 0 0 2px rgba(255,255,255,.52)}
.city-ship-art{display:grid;place-items:center;min-width:0;border-bottom:1px solid rgba(153,122,69,.27)}
.city-ship-art .ship-illustration-dock{float:none;width:100%;height:78px;margin:0}
.dock-ship.city-ship-card .dock-ship-main{display:grid;gap:2px;min-width:0;padding:0;border:0;background:transparent;color:#1e4142;text-align:center;cursor:pointer}
.dock-ship.city-ship-card .dock-ship-main b{overflow:hidden;font:600 18px/1.1 Georgia,serif;text-overflow:ellipsis;white-space:nowrap}
.dock-ship.city-ship-card .dock-ship-main small{margin:0;color:#6c654f;font-size:11px;line-height:1.2}
.city-ship-status-list{display:grid;gap:4px;min-width:0}
.city-ship-status{display:grid;grid-template-columns:18px 1fr 43px minmax(42px,.8fr);align-items:center;gap:5px;min-width:0;color:#35504a;font-size:10px;line-height:1.1}
.city-ship-status>img{width:17px;height:17px;object-fit:contain}
.city-ship-status>img{width:27px;height:27px;padding:2px;box-sizing:border-box;border-radius:6px;background:rgba(255,255,255,.72);filter:drop-shadow(0 1px 1px rgba(29,44,40,.2))}
.city-ship-status{grid-template-columns:29px 1fr 48px minmax(42px,.8fr);gap:5px;font-size:11px}
.city-ship-status>strong{text-align:right;font-size:10px;font-weight:600;white-space:nowrap}
.city-ship-status.is-warning>strong{color:#a53f32}
.city-ship-meter{display:block;height:8px;overflow:hidden;border:1px solid #b5a47b;border-radius:99px;background:#d8ceb3;box-shadow:inset 0 1px 2px rgba(52,42,24,.18)}
.city-ship-meter i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#387b70,#6ca58a);box-shadow:inset 0 1px rgba(255,255,255,.4)}
.city-ship-status.is-warning .city-ship-meter i{background:linear-gradient(90deg,#a9473b,#d77c54)}
.city-convoy-button{min-height:42px;padding:7px 10px;border:1px solid #a87a34;border-radius:7px;background:linear-gradient(180deg,#185d60,#10484d);box-shadow:inset 0 1px rgba(255,255,255,.18),0 2px 4px rgba(18,42,40,.18);color:#fff0c9;font:600 13px/1 Georgia,serif;cursor:pointer;touch-action:manipulation;transition:filter .15s,transform .15s,box-shadow .15s}
.city-convoy-button:hover{filter:brightness(1.12);box-shadow:inset 0 1px rgba(255,255,255,.22),0 4px 9px rgba(18,42,40,.25)}
.city-convoy-button:focus-visible{outline:3px solid #e5bf69;outline-offset:2px}
.city-convoy-button:active{transform:translateY(1px)}
@media(max-width:1100px){
 #app:has(>.world-main.view-city)>.topbar .city-header-context{height:64px;max-height:64px;grid-template-columns:minmax(75px,.8fr) minmax(0,1fr) minmax(0,1fr);gap:4px;padding:4px 6px}
 #app:has(>.world-main.view-city)>.topbar .city-header-context .eyebrow{font-size:7px;letter-spacing:.7px}
 #app:has(>.world-main.view-city)>.topbar .city-header-name{font-size:14px}
 #app:has(>.world-main.view-city)>.topbar .city-header-nation{font-size:11px}
 #app:has(>.world-main.view-city)>.topbar .city-header-nation img{width:21px;height:14px}
 #app:has(>.world-main.view-city)>.topbar .city-header-identity>small{font-size:9px}
 #app>.topbar:has(>.city-header-context){display:flex;grid-template-columns:minmax(150px,180px) minmax(0,1fr) minmax(0,1fr) minmax(76px,auto) minmax(92px,auto) minmax(126px,auto) 34px;grid-template-areas:"brand context context cash date speed menu";gap:7px;padding:6px 10px;flex-wrap:nowrap}
 #app>.topbar:has(>.city-header-context)>.brand{grid-area:brand;min-width:0}
 #app>.topbar:has(>.city-header-context)>.brand .brand-logo{width:164px;max-height:52px}
 .city-header-context{grid-area:context;grid-template-columns:minmax(88px,.8fr) minmax(96px,1fr) minmax(92px,1fr);gap:7px;padding:7px 8px}
 .city-header-goods{padding-left:6px}
 .city-header-goods>div{gap:3px 6px}
 .city-header-good{font-size:10px}
 .city-header-good img{width:19px;height:19px}
 #app>.topbar:has(>.city-header-context)>.resource-cash{grid-area:cash;min-width:0}
 #app>.topbar:has(>.city-header-context)>.calendar{grid-area:date;min-width:0}
 #app>.topbar:has(>.city-header-context)>.time-controls{grid-area:speed;padding:3px}
 #app>.topbar:has(>.city-header-context)>.time-controls button{width:28px;min-width:28px;height:34px;padding:3px}
 #app>.topbar:has(>.city-header-context)>.icon-button{grid-area:menu;width:32px;height:32px}
 .city-dock{left:2%;right:2%;bottom:20px;gap:9px;max-width:96%;max-height:42%}
 .dock-ship.city-ship-card{flex-basis:230px;width:230px;min-width:214px}
}
@media(max-width:850px){.city-ship-status{grid-template-columns:27px 1fr 44px minmax(34px,.7fr);gap:4px}.city-ship-status>img{width:25px;height:25px}}
@media(max-width:850px){
 #app:has(>.world-main.view-city)>.topbar .city-header-context{height:64px;max-height:64px;grid-template-columns:minmax(58px,.8fr) minmax(0,1fr) minmax(0,1fr);gap:3px;padding:3px 4px}
 #app:has(>.world-main.view-city)>.topbar .city-header-identity>small{display:none}
 #app:has(>.world-main.view-city)>.topbar .city-header-goods>div{gap:0 4px}
 #app:has(>.world-main.view-city)>.topbar .city-header-good{font-size:8px}
 #app:has(>.world-main.view-city)>.topbar .city-header-good img{width:14px;height:14px}
 #app>.topbar:has(>.city-header-context){grid-template-columns:minmax(126px,160px) minmax(0,1fr) minmax(72px,auto) minmax(86px,auto) minmax(124px,auto) 32px;grid-template-areas:"brand context context context context context" "brand cash cash date speed menu";gap:6px;padding:5px 7px}
 #app>.topbar:has(>.city-header-context)>.resource-cash{justify-self:center}
 .city-header-context{grid-template-columns:minmax(75px,.75fr) minmax(90px,1fr) minmax(82px,1fr);gap:5px;padding:6px}
 .city-header-name{font-size:16px}
 .city-header-nation{font-size:12px}
 .city-header-nation img{width:26px;height:17px}
 .city-header-context .eyebrow{font-size:8px}
 .city-header-identity>small{font-size:10px}
 .city-header-good{gap:2px;font-size:9px}
 .city-header-good img{width:17px;height:17px}
 .city-dock{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;overflow-x:hidden;overflow-y:auto;max-height:40%;padding:5px}
 .dock-ship.city-ship-card{grid-template-rows:64px auto auto 38px;gap:5px;width:auto;min-width:0;padding:6px}
 .city-ship-art .ship-illustration-dock{height:62px}
 .dock-ship.city-ship-card .dock-ship-main b{font-size:15px}
 .city-ship-status{grid-template-columns:16px 1fr 39px minmax(30px,.7fr);gap:3px;font-size:9px}
 .city-ship-status>img{width:15px;height:15px}
 .city-ship-status>strong{font-size:9px}
 .city-convoy-button{min-height:38px;font-size:12px}
}
@media(max-width:600px){
 .city-header-context{grid-template-columns:1fr;gap:4px}
 .city-header-goods{padding:4px 0 0;border-left:0;border-top:1px solid rgba(137,105,54,.25)}
 .city-header-goods>div{gap:2px 7px}
 .city-dock{grid-template-columns:minmax(0,1fr);max-height:38%;}
 .dock-ship.city-ship-card{grid-template-columns:68px minmax(0,1fr);grid-template-rows:auto auto auto;align-items:center;gap:4px 7px}
 .city-ship-art{grid-column:1;grid-row:1/4;border:0}
 .city-ship-art .ship-illustration-dock{height:56px}
 .dock-ship.city-ship-card .dock-ship-main{grid-column:2}
 .dock-ship.city-ship-card .city-ship-status-list{grid-column:1/-1}
 .dock-ship.city-ship-card .city-convoy-button{grid-column:1/-1}
}

/* Keep the accepted city-shell dimensions consistent across map and main hubs. */
#app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar{height:85px;min-height:85px;padding:3px 18px}
#app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.brand{flex:0 0 260px;min-width:0;margin-right:0;flex-shrink:0}
#app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar .brand-logo{display:block;width:260px;max-width:100%;height:auto;max-height:78px;object-fit:contain;object-position:left center;flex-shrink:0}
#app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.resource-cash{margin-left:auto}
#app:has(>.world-main.view-map)>.topbar{position:relative;inset:auto}
#app:has(>.world-main:is(.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace)){--hub-topbar-space:85px}
.dock-ship.city-ship-card{grid-template-rows:88px auto auto 42px}
.dock-ship.city-ship-card .city-ship-art{height:88px;min-height:0;overflow:hidden}
.dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{width:100%;height:78px;max-width:100%;max-height:78px;margin:0;overflow:hidden}
.dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{display:block;width:auto;height:auto;max-width:100%;max-height:78px;object-fit:contain}
.dock-ship.city-ship-card .dock-ship-main{grid-row:2;align-self:center;min-height:0;overflow:visible}
.dock-ship.city-ship-card .dock-ship-main b{display:block;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
.dock-ship.city-ship-card .city-ship-status-list{grid-row:3}
.dock-ship.city-ship-card .city-convoy-button{grid-row:4}
.city-header-identity{gap:0}
.city-header-context .eyebrow{font-size:8px;line-height:1}
.city-header-name{font-size:clamp(15px,1.1vw,19px);line-height:1}
.city-header-nation{font-size:13px;line-height:1}
.city-header-identity>small{font-size:9px;line-height:1}
@media(max-width:1100px){
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar{height:79px;min-height:79px;padding:6px 10px;flex-wrap:nowrap}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.brand{flex-basis:190px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar .brand-logo{width:190px;max-height:66px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.resource-cash{margin-left:auto}
 #app:has(>.world-main:is(.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace)){--hub-topbar-space:79px}
 .dock-ship.city-ship-card{grid-template-rows:80px auto auto 38px}
 .dock-ship.city-ship-card .city-ship-art{height:80px}
 .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{height:70px;max-height:70px}
 .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{max-height:70px}
}
@media(max-width:850px){
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar{height:77px;min-height:77px;padding:5px 7px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.brand{flex-basis:176px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar .brand-logo{width:176px;max-height:65px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.resource-cash{margin-left:auto}
 #app:has(>.world-main:is(.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace)){--hub-topbar-space:77px}
 .dock-ship.city-ship-card{grid-template-rows:74px auto auto 38px}
 .dock-ship.city-ship-card .city-ship-art{height:74px}
 .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{height:64px;max-height:64px}
 .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{max-height:64px}
 #app:has(>.world-main.view-city)>.topbar .city-header-context{grid-template-columns:minmax(90px,.8fr) minmax(0,1fr) minmax(0,1fr)}
 #app:has(>.world-main.view-city)>.topbar .city-header-identity>small{display:block;white-space:nowrap}
}
@media(max-width:600px){
 .dock-ship.city-ship-card{grid-template-rows:auto auto auto}
 .dock-ship.city-ship-card .city-ship-art{grid-row:1/4}
 .dock-ship.city-ship-card .dock-ship-main{grid-row:1}
 .dock-ship.city-ship-card .city-ship-status-list{grid-row:2}
 .dock-ship.city-ship-card .city-convoy-button{grid-row:3}
 #app:has(>.world-main.view-city)>.topbar .city-header-context{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #app:has(>.world-main.view-city)>.topbar .city-header-identity{grid-column:1/-1}
}
.city-header-identity{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:1px;align-content:center;min-height:0}
.city-header-name-row{display:flex;align-items:center;gap:6px;min-width:0;min-height:0}
.city-header-flag{display:block;flex:0 0 30px;width:30px;height:40px;object-fit:contain;object-position:center;filter:drop-shadow(0 1px 1px rgba(29,44,40,.2))}
.city-header-name-copy{display:grid;gap:2px;min-width:0;align-content:center}
.city-header-name-copy .city-header-name{display:block;max-width:100%}
.city-header-name-copy .city-header-nation{display:block;overflow:hidden;color:#294a48;font:11px/1.05 Georgia,serif;text-overflow:ellipsis;white-space:nowrap}
.city-header-identity>small.city-header-population{display:flex;align-items:center;gap:4px;min-width:0;margin:0;padding-left:36px;font-size:10px;line-height:1;white-space:nowrap}
.city-header-population img{display:block;flex:0 0 14px;width:14px;height:14px;object-fit:contain}
@media(max-width:1100px){.city-header-flag{height:38px;width:28px;flex-basis:28px}.city-header-identity>small.city-header-population{font-size:9px;padding-left:34px}}

/* Keep location identity readable and consistent in every city hotspot topbar. */
.city-header-context .city-header-flag{width:34px;height:44px;flex-basis:34px;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0!important}
.city-header-context .city-header-name{font-size:clamp(18px,1.25vw,22px)}
.city-header-context .city-header-name-copy .city-header-nation{font-size:13px}
.city-header-context .city-header-identity>small.city-header-population{font-size:11px}
@media(max-width:1100px){.city-header-context .city-header-flag{width:30px;height:40px;flex-basis:30px}.city-header-context .city-header-name{font-size:16px}.city-header-context .city-header-name-copy .city-header-nation{font-size:12px}.city-header-context .city-header-identity>small.city-header-population{font-size:10px}}
@media(max-width:850px){.city-header-context .city-header-flag{width:28px;height:38px;flex-basis:28px}.city-header-context .city-header-name{font-size:15px}}
#app:has(>.world-main.view-city)>.topbar .city-header-context .city-header-name{font-size:16px}
@media(max-width:850px){#app:has(>.world-main.view-city)>.topbar .city-header-context .city-header-name{font-size:15px}}

@media(max-width:1100px){
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context){display:grid;height:96px;min-height:96px;padding:4px 8px;gap:3px 6px;grid-template-columns:minmax(150px,180px) minmax(0,1fr) 88px 140px 118px 34px;grid-template-rows:52px 34px;grid-template-areas:"brand context context context context context" "brand cash date speed menu menu";align-content:center;overflow:hidden}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.brand{grid-area:brand;align-self:center;min-width:0;margin:0;flex:initial}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.brand .brand-logo{width:164px;max-height:56px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.city-header-context{grid-area:context;width:100%;height:50px;max-height:50px;grid-template-columns:minmax(110px,.8fr) minmax(0,1fr) minmax(0,1fr);gap:5px;padding:4px 7px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.city-header-context .city-header-good img{width:17px;height:17px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.resource-cash{grid-area:cash;justify-self:center;min-width:0;margin:0}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.calendar{grid-area:date;justify-self:center;min-width:0}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.resource-with-art{gap:4px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .hud-art{width:25px;height:25px;flex-basis:25px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .resource-copy small{font-size:8px;letter-spacing:.4px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .resource-copy strong,#app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .resource .gold{font-size:15px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.time-controls{grid-area:speed;justify-self:center;padding:2px;gap:1px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.time-controls button{width:27px;min-width:27px;height:31px;padding:2px;font-size:10px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.icon-button{grid-area:menu;justify-self:end;width:30px;height:30px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office)){--hub-topbar-space:108px}
}
@media(max-width:850px){
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context){grid-template-columns:minmax(125px,140px) minmax(0,1fr) 76px 140px 118px 32px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.brand .brand-logo{width:124px;max-height:48px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.city-header-context{grid-template-columns:minmax(95px,.8fr) minmax(0,1fr) minmax(0,1fr);gap:3px;padding:3px 5px}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-identity{gap:0}
  #app:has(>.world-main:is(.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population img{width:15px;height:15px;flex-basis:15px}
}

/* Give production and demand goods equal, clearly readable weight. */
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .eyebrow{font-size:10px;letter-spacing:1px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.city-header-context{column-gap:8px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods{gap:2px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods>div{gap:0 8px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good{flex-direction:column;gap:0;font-size:12px;line-height:1.05;text-align:center}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good img{width:26px;height:26px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population{font-size:14px}
#app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population img{width:22px;height:22px;flex-basis:22px}
@media(max-width:1100px){
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .eyebrow{font-size:9px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good{font-size:11px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good img{width:23px;height:23px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context)>.city-header-context{padding:0 5px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-flag{width:22px;height:28px;flex-basis:22px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-name-copy{gap:0}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population{font-size:11px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population img{width:16px;height:16px;flex-basis:16px}
}
@media(max-width:850px){
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .eyebrow{font-size:8px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good{font-size:10px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-goods .city-header-good img{width:20px;height:20px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population img{width:15px;height:15px;flex-basis:15px}
 #app:has(>.world-main:is(.view-city,.view-marketplace,.view-office))>.topbar:has(>.city-header-context) .city-header-population{transform:translateY(-2px)}
}

/* At compact widths, move city details beside the docked ship and keep the HUD on one row. */
.city-fleet-rail{display:contents}
.city-scene-location-card{display:none}
.city-ship-switcher{display:none}
@media(max-width:1100px){
 #app:has(>.world-main.view-city)>.topbar:has(>.city-header-context)>.city-header-context{display:none}
 #app:has(>.world-main.view-city) .city-fleet-rail{position:absolute;z-index:6;left:1%;bottom:14px;display:grid;grid-template-columns:minmax(300px,360px) minmax(250px,393px);justify-content:space-between;align-items:end;gap:8px;width:98%;max-height:calc(100% - 100px);overflow-y:auto;scrollbar-width:thin}
 #app:has(>.world-main.view-city) .city-fleet-rail{pointer-events:none}
 #app:has(>.world-main.view-city) .city-fleet-rail>*{pointer-events:auto}
 #app:has(>.world-main.view-city) .city-scene-location-card{display:block;min-width:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{box-sizing:border-box;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 9px;width:100%;height:auto;min-height:0;max-height:none;padding:8px;overflow:visible}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-column:1/-1;grid-template-rows:auto auto;gap:2px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name{font-size:18px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name-copy .city-header-nation{font-size:12px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-flag{width:30px;height:38px;flex-basis:30px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{padding-left:34px;font-size:12px;transform:none}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-population img{width:18px;height:18px;flex-basis:18px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods{gap:2px;padding:4px 0 0;border:0;border-top:1px solid rgba(137,105,54,.25)}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods .eyebrow{font-size:9px;letter-spacing:.8px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods>div{justify-content:flex-start;gap:0 10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{flex-direction:column;gap:0;font-size:11px;line-height:1.05;text-align:center}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:23px;height:23px}
 #app:has(>.world-main.view-city) .city-dock{position:static;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:auto;max-width:none;max-height:none;padding:0;overflow:visible}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card{box-sizing:border-box;display:grid;grid-template-columns:170px minmax(0,1fr);grid-template-rows:minmax(132px,auto) auto 38px;align-items:center;gap:5px 8px;flex:0 1 auto;width:100%;min-width:0;padding:8px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art{grid-column:1;grid-row:1/3;align-self:stretch;width:170px;height:100%;max-height:none;overflow:hidden;border:0}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{width:170px;height:132px;max-height:132px;margin:0;overflow:hidden}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{max-width:166px;max-height:128px;object-fit:contain}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .dock-ship-main{grid-column:2;grid-row:1}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status-list{grid-column:2;grid-row:2;gap:3px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status{grid-template-columns:30px minmax(0,1fr) 48px minmax(46px,.8fr);gap:5px;font-size:11px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status>img{width:28px;height:28px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-convoy-button{grid-column:1/-1;grid-row:3}
 #app:has(>.world-main.view-city) .city-dock .city-ship-card:not(.active){display:none}
 #app:has(>.world-main.view-city) .city-ship-art{position:relative}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher){box-sizing:border-box;padding-bottom:24px}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher) .ship-illustration-dock{height:112px;max-height:112px}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher) .ship-illustration-dock img{max-height:108px}
 #app:has(>.world-main.view-city) .city-ship-switcher{position:absolute;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:5px;height:24px;color:#26494a;font-size:11px;white-space:nowrap}
 #app:has(>.world-main.view-city) .city-ship-switcher button{display:grid;place-items:center;width:25px;height:24px;padding:0;border:1px solid rgba(157,126,69,.48);border-radius:5px;background:#f7f0dc;color:#174f50;font:700 20px/1 Georgia,serif;cursor:pointer}
}
@media(max-width:850px){
 #app:has(>.world-main.view-city) .city-fleet-rail{grid-template-columns:minmax(0,.95fr) minmax(250px,1.05fr);width:min(760px,96%)}
}
@media(max-width:600px){
 #app:has(>.world-main.view-city) .city-fleet-rail{top:auto;bottom:12px;left:3%;grid-template-columns:minmax(0,1fr);width:min(390px,94%);max-height:calc(100% - 330px)}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 8px;padding:7px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;align-items:center}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity .city-header-name-row{grid-column:1;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{grid-column:2;grid-row:1;padding-left:0;font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-flag{width:24px;height:30px;flex-basis:24px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name{font-size:15px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name-copy .city-header-nation{font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-population img{width:15px;height:15px;flex-basis:15px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods>div{justify-content:center;gap:0 5px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:18px;height:18px}
 #app:has(>.world-main.view-city) .city-dock{gap:6px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto 38px;gap:4px 6px;padding:6px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art{grid-column:1;grid-row:1;width:100%;height:120px;max-height:120px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{width:100%;height:116px;max-height:116px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{max-width:100%;max-height:112px}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher){height:140px;max-height:140px;padding-bottom:24px}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher) .ship-illustration-dock{height:116px;max-height:116px}
 #app:has(>.world-main.view-city) .city-ship-art:has(.city-ship-switcher) .ship-illustration-dock img{max-height:112px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .dock-ship-main{grid-column:1;grid-row:2}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status-list{grid-column:1;grid-row:3}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-convoy-button{grid-column:1;grid-row:4}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status{grid-template-columns:25px minmax(0,1fr) 42px minmax(42px,.7fr);gap:3px;font-size:10px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status>img{width:24px;height:24px}
 .view-city .city-hotspots{top:130px}
}

/* Put the complete city information tile into the reserved strip above the mobile hotspots. */
@media(max-width:600px){
  #app:has(>.world-main.view-city) .city-fleet-rail{top:104px;bottom:12px;grid-template-rows:auto minmax(0,1fr);align-items:stretch;max-height:none}
 #app:has(>.world-main.view-city) .city-scene-location-card{grid-row:1;align-self:start}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{grid-template-columns:minmax(75px,.8fr) repeat(2,minmax(0,1fr));grid-template-rows:minmax(58px,auto);align-items:center;gap:2px 5px;padding:5px 6px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-column:1;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;align-content:center;gap:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name-row{gap:3px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{grid-column:1;grid-row:2;padding-left:27px;font-size:8px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods{min-width:0;gap:0;padding:0 0 0 4px;border-top:0;border-left:1px solid rgba(137,105,54,.25)}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods .eyebrow{font-size:8px;letter-spacing:.4px;white-space:nowrap}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods>div{justify-content:space-between;gap:0 2px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{min-width:0;font-size:8px;white-space:nowrap}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:17px;height:17px}
 #app:has(>.world-main.view-city) .city-dock{grid-row:2;align-self:end}
  .view-city .city-hotspots{top:190px}
}

/* Use the shared compact HUD row on the city screen and keep its city tile in view. */
@media(max-width:1100px){
 #app:has(>.world-main.view-city) .city-fleet-rail{top:116px;right:2%;bottom:12px;left:2%;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-items:stretch;width:96%;max-height:none;overflow:visible}
 #app:has(>.world-main.view-city) .city-scene-location-card{grid-row:1;align-self:start;width:min(100%,570px);position:relative;z-index:1}
 #app:has(>.world-main.view-city) .city-dock{grid-row:2;align-self:end;justify-self:start;width:min(48%,393px);max-width:393px}
}
@media(max-width:850px){
 #app:has(>.world-main.view-city) .city-fleet-rail{top:104px}
}
@media(max-width:560px){
 #app:has(>.world-main.view-city) .city-dock{justify-self:stretch;width:100%;max-width:none}
 .view-city .city-hotspots{top:190px}
}
@media(max-width:420px){
}
.city-economy-summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid #8c76544a}
.city-economy-summary>div{display:grid;gap:2px;min-width:0}
.city-economy-summary>div>span{font-size:9px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#587174}
.city-economy-summary strong{font-size:11px;line-height:1.25;color:#233f3d}
.city-economy-summary small{font-size:9px;line-height:1.3;color:#52615d}
@media(max-width:380px){.city-economy-summary{grid-template-columns:1fr}}

@media(min-width:1101px){#app:has(>.world-main.view-city)>.topbar{height:auto;min-height:85px;overflow:visible}#app:has(>.world-main.view-city)>.topbar .city-header-context{height:auto;min-height:68px;max-height:none;grid-template-columns:minmax(100px,.85fr) minmax(0,1fr) minmax(0,1fr) minmax(180px,1.4fr);overflow:visible}}

/* Sprint 1A: responsive KONTOR header branding and compact city topbar. */
.brand-picture{display:block;flex:0 1 auto;min-width:0;line-height:0}
#app:has(>.world-main.view-city){--hub-topbar-space:85px}
#app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national)){--hub-topbar-space:85px}
#app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{height:85px;min-height:85px;padding:3px 18px;gap:clamp(8px,1vw,16px);flex-wrap:nowrap;overflow:hidden}
#app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.brand{display:flex;flex:0 0 224px;min-width:0;margin:0}
#app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .brand-logo{display:block;width:224px;height:auto;max-height:72px;object-fit:contain;object-position:left center}
@media(max-width:1100px){
 #app:has(>.world-main.view-city){--hub-topbar-space:79px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national)){--hub-topbar-space:79px}
 #app:has(>.world-main.view-city)>.topbar{height:79px;min-height:79px;padding:6px 10px;overflow:hidden}
 #app:has(>.world-main.view-city)>.topbar>.brand{flex:0 0 150px}
 #app:has(>.world-main.view-city)>.topbar .brand-logo{width:132px;max-height:56px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{height:79px;min-height:79px;padding:6px 10px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.brand{flex-basis:150px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .brand-logo{width:132px;max-height:56px}
}
@media(max-width:850px){
 #app:has(>.world-main.view-city){--hub-topbar-space:84px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national)){--hub-topbar-space:84px}
 #app:has(>.world-main.view-city)>.topbar,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{display:grid;height:84px;min-height:84px;padding:6px 8px;gap:2px 6px;grid-template-columns:minmax(82px,1fr) auto auto 34px;grid-template-rows:36px 32px;grid-template-areas:"brand cash date menu" "speed speed speed speed";align-content:center;align-items:center;box-sizing:border-box;overflow:hidden}
 #app:has(>.world-main.view-city)>.topbar>.brand,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.brand{display:flex;grid-area:brand;flex:0 1 auto;min-width:0;margin:0}
 #app:has(>.world-main.view-city)>.topbar .brand-picture,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .brand-picture{max-width:126px}
 #app:has(>.world-main.view-city)>.topbar .brand-logo,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .brand-logo{width:clamp(88px,26vw,126px);max-height:34px}
 #app:has(>.world-main.view-city)>.topbar>.resource-cash,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.resource-cash{grid-area:cash;min-width:0;margin:0;justify-self:end}
 #app:has(>.world-main.view-city)>.topbar>.calendar,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.calendar{grid-area:date;min-width:0;margin:0;justify-self:end}
 #app:has(>.world-main.view-city)>.topbar>.time-controls,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls{grid-area:speed;justify-self:center;align-self:center;gap:4px;margin:0;padding:0}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button{width:31px;min-width:31px;height:28px;padding:2px}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button img,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button img{width:17px;height:17px}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button span,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button span{font-size:8px}
 #app:has(>.world-main.view-city)>.topbar>.icon-button,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.icon-button{grid-area:menu;justify-self:end;width:30px;height:30px}
}
@media(max-width:420px){
 #app:has(>.world-main.view-city)>.topbar{padding-left:6px;padding-right:10px;grid-template-columns:minmax(78px,1fr) auto auto 32px;column-gap:4px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{padding-left:6px;padding-right:10px;grid-template-columns:minmax(78px,1fr) auto auto 32px;column-gap:4px}
 #app:has(>.world-main.view-city)>.topbar .resource-copy small,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .resource-copy small{font-size:7px;letter-spacing:.35px}
 #app:has(>.world-main.view-city)>.topbar .resource-copy strong,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar .resource-copy strong{font-size:11px}
}

/* Sprint 1A: keep the responsive city profile clear of touch hotspots. */
@media(max-width:1100px){
 #app:has(>.world-main.view-city) .city-fleet-rail{top:88px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{grid-template-columns:minmax(72px,.8fr) minmax(0,1.1fr) minmax(0,1.1fr);grid-template-rows:minmax(58px,auto) auto;align-items:center;gap:4px 7px;padding:6px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods:not(.city-header-goods--demands){grid-column:2;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods--demands{grid-column:3;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-summary{grid-column:1/-1;grid-row:2;gap:8px;margin:0;padding:5px 0 0;border-top:1px solid rgba(137,105,54,.25)}
}
@media(max-width:600px){
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{grid-template-columns:minmax(66px,.8fr) minmax(0,1.1fr) minmax(0,1.1fr);gap:3px 5px;padding:5px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{grid-column:1;grid-row:2;padding-left:27px;font-size:8px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods:not(.city-header-goods--demands){grid-column:2;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods--demands{grid-column:3;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods{gap:0;padding:0 0 0 4px;border-top:0;border-left:1px solid rgba(137,105,54,.25)}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods .eyebrow{font-size:8px;letter-spacing:.35px;white-space:nowrap}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods>div{justify-content:space-between;gap:0 2px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{min-width:0;font-size:8px;white-space:nowrap}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:17px;height:17px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-summary{gap:5px}
 .view-city .city-hotspots{top:225px}
}
@media(min-width:1101px){
 #app:has(>.world-main.view-city)>.topbar>.brand{box-sizing:border-box;flex:0 0 184px;width:184px;min-width:0}
 #app:has(>.world-main.view-city)>.topbar>.brand .brand-picture{display:block;width:184px;max-width:100%}
 #app:has(>.world-main.view-city)>.topbar>.brand .brand-logo{width:184px;max-width:100%;max-height:68px}
 #app:has(>.world-main.view-city)>.topbar .city-header-context{flex:1 1 610px;grid-template-columns:minmax(142px,1.05fr) minmax(122px,.95fr) minmax(104px,.8fr) minmax(220px,1.4fr)}
 #app:has(>.world-main.view-city)>.topbar .city-header-population{font-size:10px}
 #app:has(>.world-main.view-city)>.topbar .city-header-population img{width:16px;height:16px;flex-basis:16px}
}

/* Sprint 1A: keep the menu inside the compact shared HUD after its grid rules. */
@media(max-width:420px){#app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city))>.topbar{padding-right:10px}}


/* Sprint 1A device QA: use the round signet when the full wordmark crowds the HUD. */
@media(max-width:1100px){
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar>.brand{flex:0 0 54px;width:54px;min-width:54px;justify-content:center}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar .brand-picture{width:48px;max-width:48px}
 #app:has(>.world-main:is(.view-map,.view-ships,.view-office,.view-log,.view-career,.view-city,.view-marketplace))>.topbar .brand-logo{width:48px;height:48px;max-height:48px;object-fit:contain;object-position:center}
}

/* On mobile, let the profile determine where the hotspot grid starts. */
@media(max-width:600px){
 #app>.world-main.view-city:not(.has-place)>.city-scene{box-sizing:border-box;display:flex;flex-direction:column;align-items:stretch;gap:5px;width:100%;height:100%;min-height:0;max-height:100%;padding:calc(var(--hub-topbar-space,84px) + 8px) 10px calc(8px + env(safe-area-inset-bottom,0px));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:none}
 #app>.world-main.view-city:not(.has-place)>.city-scene::-webkit-scrollbar{display:none}
 #app>.world-main.view-city:not(.has-place) .city-fleet-rail{position:static;inset:auto;display:contents;width:auto;max-height:none;overflow:visible;grid-template-columns:none;grid-template-rows:none}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card{position:relative;inset:auto;z-index:6;order:1;flex:0 0 auto;align-self:stretch;width:100%;max-width:none;min-width:0}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-context{box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;align-items:start;gap:4px 6px;width:100%;height:auto;min-height:0;max-height:none;padding:5px;overflow:visible}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-identity{grid-column:1/-1;grid-row:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;align-items:start;gap:2px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-name-row{min-width:0}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-name{font-size:15px;white-space:normal;overflow-wrap:anywhere}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-identity>small.city-header-population{grid-column:1;grid-row:auto;padding-left:27px;font-size:9px;white-space:normal}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods{grid-row:auto;align-self:start;min-width:0;gap:3px;padding:5px 0 0;border:0;border-top:1px solid rgba(137,105,54,.25)}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods:not(.city-header-goods--demands){grid-column:1}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods--demands{grid-column:2}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods .eyebrow{font-size:8px;letter-spacing:.35px;white-space:normal}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch;align-items:start;gap:3px 4px;min-width:0}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-good{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:2px;min-width:0;font-size:8px;line-height:1;text-align:left;white-space:normal}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-good img{flex:0 0 16px;width:16px;height:16px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-good>span{min-width:0;overflow-wrap:anywhere}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary{grid-column:1/-1;grid-row:auto;grid-template-columns:minmax(0,1fr);gap:3px;margin:0;padding:4px 0 0;border-top:1px solid rgba(137,105,54,.25)}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary>div{min-width:0}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary strong,
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary small{overflow-wrap:anywhere}
 #app>.world-main.view-city:not(.has-place) .city-hotspots{position:relative;inset:auto;z-index:7;order:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(46px,auto);gap:5px;width:100%;margin:0;flex:0 0 auto}
 #app>.world-main.view-city:not(.has-place) .city-hotspot{box-sizing:border-box;position:relative;inset:auto;transform:none;justify-content:flex-start;gap:6px;width:100%;min-width:0;max-width:none;min-height:46px;padding:4px 6px;font-size:14px;line-height:1.1;white-space:normal;overflow-wrap:anywhere}
 #app>.world-main.view-city:not(.has-place) .city-hotspot>span{flex:0 0 36px;width:36px;height:36px}
 #app>.world-main.view-city:not(.has-place) .city-hotspot .hotspot-art{width:34px;height:34px}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="market"]{order:1}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="yard"]{order:2}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="office"]{order:3}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="harbor"]{order:4}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="tavern"]{order:5}
 #app>.world-main.view-city:not(.has-place) .city-hotspot[data-place="governor"]{order:6}
 #app>.world-main.view-city:not(.has-place) .city-dock{position:relative;inset:auto;z-index:6;order:3;align-self:stretch;justify-self:stretch;width:100%;max-width:none;max-height:none;margin:0 0 auto;overflow:visible;padding:0}
}

/* PR #48 final header QA: restore a single HUD row on tablet widths. */
@media(min-width:560px) and (max-width:850px){
 #app:has(>.world-main.view-city)>.topbar,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{grid-template-columns:54px minmax(92px,1fr) max-content max-content 32px;grid-template-rows:minmax(0,1fr);grid-template-areas:"brand cash date speed menu"}
 #app:has(>.world-main.view-city)>.topbar>.time-controls,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls{gap:2px;padding:4px}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button{width:46px;min-width:46px;height:55px;padding:3px 4px}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button img,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button img{width:29px;height:29px}
 #app:has(>.world-main.view-city)>.topbar>.time-controls button span,
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar>.time-controls button span{font-size:10px}
}


/* Sprint 1B: compact status signets, desktop-only hover details, and one-card city fleet carousel. */
.city-status-summary{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;margin:0;padding:0;border:0;overflow:visible}
.city-status-graphic{position:relative;display:grid;grid-template-columns:36px minmax(0,1fr);align-items:center;gap:6px;min-width:0;color:#294743;font-size:11px;font-weight:700;line-height:1.15;cursor:help;outline-offset:3px}
.city-status-graphic>img{display:block;width:36px;height:36px;object-fit:contain}
.city-status-graphic>span:not(.city-status-tooltip){min-width:0;overflow-wrap:anywhere}
.city-status-tooltip{position:absolute;top:calc(100% + 8px);left:0;z-index:60;box-sizing:border-box;width:min(300px,calc(100vw - 24px));padding:10px 12px;border:1px solid #bda16a;border-radius:8px;background:#fff9e9;box-shadow:0 8px 24px rgba(15,36,34,.28);color:#283f3b;font-size:12px;font-weight:500;line-height:1.45;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .12s ease}
.city-status-graphic-supply .city-status-tooltip{right:0;left:auto}
.city-status-graphic:focus-visible{outline:2px solid #b48b42;border-radius:6px}
@media(hover:hover) and (pointer:fine){.city-status-graphic:hover .city-status-tooltip,.city-status-graphic:focus-visible .city-status-tooltip{visibility:visible;opacity:1}}
@media(hover:none),(pointer:coarse){.city-status-tooltip{display:none}}
.topbar .city-info-details-content>.city-status-summary .city-status-graphic{display:grid;grid-template-columns:40px minmax(0,1fr);grid-template-areas:"art label" "art detail";align-content:start;align-items:center;gap:4px 9px;min-width:0;padding:11px;border:1px solid #ddcfaa;border-radius:8px;background:#fffdf7;color:#304b4d;font-size:14px;line-height:1.4;cursor:default}
.topbar .city-info-details-content>.city-status-summary .city-status-graphic>img{grid-area:art;width:40px;height:40px}
.topbar .city-info-details-content>.city-status-summary .city-status-graphic>.city-status-label{grid-area:label;color:#203c3e;font-size:15px;font-weight:700;line-height:1.3}
.topbar .city-info-details-content>.city-status-summary .city-status-graphic>.city-status-detail{grid-area:detail;color:#405b56;font-size:13px;line-height:1.5}
.topbar .city-info-details-content .city-status-graphic>.city-status-tooltip{display:none}
@media(max-width:600px){.topbar .city-info-details-content>.city-status-summary{grid-template-columns:minmax(0,1fr)}.topbar .city-info-details-content>.city-status-summary .city-status-graphic{grid-template-columns:36px minmax(0,1fr);gap:4px 8px;padding:9px}.topbar .city-info-details-content>.city-status-summary .city-status-graphic>img{width:36px;height:36px}.topbar .city-info-details-content>.city-status-summary .city-status-graphic>.city-status-label{font-size:14px}.topbar .city-info-details-content>.city-status-summary .city-status-graphic>.city-status-detail{font-size:12px}}
@media(max-width:850px){.city-status-graphic{grid-template-columns:30px minmax(0,1fr);gap:4px;font-size:10px}.city-status-graphic>img{width:30px;height:30px}}
#app:has(>.world-main.view-city) .city-scene-location-card .city-status-summary{grid-column:1/-1;grid-row:2;display:flex;gap:8px;margin:0;padding:5px 0 0;border-top:1px solid rgba(137,105,54,.25)}
@media(max-width:600px){#app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary{grid-column:1/-1;grid-row:auto;display:flex;gap:6px;margin:0;padding:4px 0 0;border-top:1px solid rgba(137,105,54,.25)}}
.city-dock{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;justify-items:center;align-content:end;align-items:end;gap:8px;overflow-x:hidden;overflow-y:auto}
.dock-ship.city-ship-card.city-carousel-item{box-sizing:border-box;flex:0 0 min(100%,340px);width:min(100%,340px);min-width:0}
.city-carousel-item{max-width:100%}
.city-ship-switcher{position:relative;inset:auto;display:flex;grid-row:2;align-items:center;justify-content:center;gap:12px;width:100%;min-height:44px;margin:0;padding:0}
.city-ship-switcher button{box-sizing:border-box;display:grid;place-items:center;width:44px;min-width:44px;height:44px;padding:0;border:1px solid #b49254;border-radius:9px;background:linear-gradient(180deg,#fff9e9,#ead8ae);color:#19484a;font:700 25px/1 Georgia,serif;box-shadow:0 2px 5px rgba(13,39,42,.2);touch-action:manipulation}
.city-ship-switcher button:focus-visible{outline:3px solid #e5bf69;outline-offset:2px}
.city-ship-switcher span{min-width:52px;text-align:center;color:#fff4d8;font-size:13px;font-weight:700;text-shadow:0 1px 3px #152e2e}
.dock-ship.dock-convoy.city-carousel-item{box-sizing:border-box;display:grid;grid-template-columns:minmax(72px,100px) minmax(0,1fr);grid-template-rows:1fr auto;align-items:center;gap:10px;width:min(100%,340px);min-height:205px;padding:12px;border:1px solid #c1a66d;border-radius:10px;background:linear-gradient(145deg,rgba(255,251,235,.97),rgba(238,224,190,.96));box-shadow:0 6px 18px rgba(13,39,42,.4),inset 0 0 0 3px rgba(255,255,255,.44);color:#1e4142;text-align:left;cursor:pointer;backdrop-filter:blur(3px)}
.city-convoy-art{position:relative;display:grid;grid-row:1/-1;place-items:center;min-width:0;width:100%;height:100%;min-height:110px;border-right:1px solid rgba(153,122,69,.27)}
.city-convoy-art .ship-illustration-dock{display:grid;place-items:center;width:100%;height:96px;margin:0;overflow:hidden}
.city-convoy-art .ship-illustration-dock img{display:block;max-width:100%;max-height:96px;object-fit:contain}
.city-convoy-art .convoy-dock-badge{position:absolute;right:5px;bottom:3px;display:flex;align-items:center;gap:3px;padding:3px 6px;border:1px solid rgba(180,139,66,.5);border-radius:99px;background:#fff8e8;color:#21494a;font-size:12px}
.city-convoy-art .convoy-dock-badge img{width:22px;height:22px;object-fit:contain}
.city-convoy-copy{display:grid;gap:7px;min-width:0}
.city-convoy-copy>b{font:600 18px/1.15 Georgia,serif;overflow-wrap:anywhere}
.city-convoy-copy>small{color:#5d604f;font-size:12px;line-height:1.35;overflow-wrap:anywhere}
.city-convoy-open{grid-column:2;align-self:end;justify-self:stretch;padding:10px;border:1px solid #a87a34;border-radius:7px;background:linear-gradient(180deg,#185d60,#10484d);color:#fff0c9;font:600 13px/1 Georgia,serif;text-align:center}
.city-dock-empty{justify-self:center;align-self:end;color:#fff4d8;text-shadow:0 1px 3px #152e2e}
.governor-city-economy{display:grid;gap:10px;margin:14px 0;padding:14px;border:1px solid rgba(204,174,110,.55);border-radius:10px;background:rgba(30,55,50,.62);color:#fff4dc}
.governor-city-economy>.eyebrow{color:#e2c98c}
.governor-city-economy h3{margin:0;font:600 20px/1.15 Georgia,serif}
.governor-city-economy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.governor-city-economy-grid>div{display:grid;gap:5px;min-width:0;padding:10px;border-radius:7px;background:rgba(12,35,34,.42)}
.governor-city-economy-grid b{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#e2c98c}
.governor-city-economy-grid span{font-size:14px;line-height:1.3;overflow-wrap:anywhere}
.governor-city-economy-grid small{font-size:12px;line-height:1.4;color:#eee0c0;overflow-wrap:anywhere}
@media(max-width:560px){.governor-city-economy-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:420px){.dock-ship.dock-convoy.city-carousel-item{grid-template-columns:70px minmax(0,1fr);gap:8px;min-height:190px;padding:9px}.city-convoy-copy>b{font-size:16px}}

.view-city .city-dock{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;justify-items:center;align-content:end;align-items:end;gap:8px;overflow-x:hidden}
@media(max-width:850px){.view-city .city-dock{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;justify-items:center;align-content:end;align-items:end;gap:8px;overflow-x:hidden}}

/* The carousel controls now follow the active card in document flow, not over its artwork. */
#app:has(>.world-main.view-city) .city-dock{position:static;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;justify-items:center;align-content:end;align-items:end;gap:8px;overflow-x:hidden;overflow-y:auto}
#app:has(>.world-main.view-city) .city-ship-switcher{position:relative;inset:auto;display:flex;grid-row:2;align-items:center;justify-content:center;gap:12px;width:auto;height:auto;min-height:44px;margin:0;padding:0}
#app:has(>.world-main.view-city) .city-ship-switcher button{box-sizing:border-box;width:44px;min-width:44px;height:44px;padding:0;border:1px solid #b49254;border-radius:9px;background:linear-gradient(180deg,#fff9e9,#ead8ae);color:#19484a;font:700 25px/1 Georgia,serif;touch-action:manipulation}
@media(min-width:601px) and (max-width:850px) and (max-height:950px){
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card.city-carousel-item{height:166px;min-height:166px;grid-template-columns:96px minmax(0,1fr);grid-template-rows:27px minmax(0,1fr) 30px;gap:3px 7px;padding:6px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art{grid-column:1;grid-row:1/3;width:96px;height:100%;max-height:none}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock{width:92px;height:86px;max-height:86px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-art .ship-illustration-dock img{max-width:90px;max-height:82px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .dock-ship-main{grid-column:2;grid-row:1}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status-list{grid-column:2;grid-row:2;gap:2px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status{grid-template-columns:22px minmax(0,1fr) 40px minmax(32px,.7fr);gap:3px;font-size:9px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-ship-status>img{width:20px;height:20px}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card .city-convoy-button{grid-column:1/-1;grid-row:3;min-height:30px;padding:4px 7px;font-size:12px}
 #app:has(>.world-main.view-city) .dock-ship.dock-convoy.city-carousel-item{height:166px;min-height:166px;grid-template-columns:76px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:6px;padding:8px}
 #app:has(>.world-main.view-city) .city-convoy-art .ship-illustration-dock{height:84px}
 #app:has(>.world-main.view-city) .city-convoy-art .ship-illustration-dock img{max-height:82px}
 #app:has(>.world-main.view-city) .city-convoy-copy{gap:4px}
 #app:has(>.world-main.view-city) .city-convoy-copy>b{font-size:15px}
 #app:has(>.world-main.view-city) .city-convoy-copy>small{font-size:10px}
 #app:has(>.world-main.view-city) .city-convoy-open{padding:7px;font-size:12px}
}

#app:has(>.world-main.view-city) .city-dock .city-ship-card.city-carousel-item{display:grid;border:2px solid #b3873e}

@media(max-width:600px){
 #app:has(>.world-main.view-city){--hub-topbar-space:96px}
 #app:has(>.world-main.view-city)>.topbar{height:96px;min-height:96px;grid-template-rows:36px 44px}
}

/* Sprint 1B device QA: status signets share the tablet profile row with its existing columns. */
@media(min-width:601px) and (max-width:1100px){
 #app:has(>.world-main.view-city) .city-scene-location-card{width:min(100%,620px);max-width:620px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{grid-template-columns:minmax(116px,1.15fr) minmax(78px,.85fr) minmax(74px,.8fr) minmax(84px,1.1fr) minmax(84px,1.1fr);grid-template-rows:minmax(52px,auto);align-items:center;gap:4px 6px;padding:7px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity{grid-column:1;grid-row:1;min-width:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name{font-size:15px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name-copy .city-header-nation{font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-flag{width:26px;height:32px;flex-basis:26px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{padding-left:0;font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-population img{width:15px;height:15px;flex-basis:15px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods:not(.city-header-goods--demands){grid-column:2;grid-row:1;min-width:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods--demands{grid-column:3;grid-row:1;min-width:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-summary{display:contents;margin:0;padding:0;border:0}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-graphic-labor{grid-column:4;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-graphic-supply{grid-column:5;grid-row:1}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-graphic{grid-template-columns:28px minmax(0,1fr);gap:4px;font-size:9px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-status-graphic>img{width:28px;height:28px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-goods>div{gap:0 2px}
}
@media(min-width:601px) and (max-width:1100px){
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-context{padding:4px 7px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{font-size:11px;line-height:1.1;white-space:normal;flex-wrap:wrap}
}
@media(min-width:601px) and (max-width:850px){
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{font-size:10px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:20px;height:20px}
}
@media(min-width:851px) and (max-width:1100px){
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-name{font-size:16px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-identity>small.city-header-population{font-size:11px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-population img{width:18px;height:18px;flex-basis:18px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good{font-size:11px}
 #app:has(>.world-main.view-city) .city-scene-location-card .city-header-good img{width:23px;height:23px}
}
@media(min-width:1101px){
 #app:has(>.world-main.view-city) .city-dock{position:absolute;z-index:6;top:auto;right:auto;bottom:24px;left:4%;width:min(100%,440px);max-width:440px;max-height:none;padding:0;overflow:visible;transform:none}
 #app:has(>.world-main.view-city) .dock-ship.city-ship-card.city-carousel-item{min-height:clamp(205px,26vh,260px)}
}
.governor-city-economy-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.governor-city-economy-heading>b{min-width:0}
.governor-city-economy-heading .city-status-graphic{grid-template-columns:24px minmax(0,1fr);gap:4px;max-width:132px;font-size:10px}
.governor-city-economy-heading .city-status-graphic>img{width:24px;height:24px}
@media(max-width:560px){.governor-city-economy-heading{flex-wrap:wrap}.governor-city-economy-heading .city-status-graphic{margin-left:auto}}

/* The phone profile uses one row for identity and status, then one for goods. */
#app .city-header-identity>small.city-header-population{padding-left:0!important}
@media(max-width:600px){
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-context{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:auto auto;align-items:center;gap:4px 5px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-identity{grid-column:1/3;grid-row:1}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-name{font-size:14px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-flag{width:22px;height:28px;flex-basis:22px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods:not(.city-header-goods--demands){grid-column:1/4;grid-row:2}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-header-goods--demands{grid-column:4/7;grid-row:2}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-summary{display:contents;margin:0;padding:0;border:0}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-graphic-labor{grid-column:3/5;grid-row:1}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-graphic-supply{grid-column:5/7;grid-row:1}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-graphic{grid-template-columns:26px minmax(0,1fr);gap:3px;font-size:9px}
 #app>.world-main.view-city:not(.has-place) .city-scene-location-card .city-status-graphic>img{width:26px;height:26px}
}
.governor-city-economy-heading .city-status-graphic{grid-template-columns:30px minmax(0,1fr);max-width:150px;color:#fff4dc}
.governor-city-economy-heading .city-status-graphic>img{width:30px;height:30px}
.governor-city-economy-grid>div{background:#173632}
@media(min-width:560px) and (max-width:600px){
 #app:has(>.world-main.view-city){--hub-topbar-space:84px}
 #app:has(>.world-main.view-city)>.topbar{height:84px;min-height:84px;grid-template-rows:minmax(0,1fr)}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national)){--hub-topbar-space:84px}
 #app:has(>.world-main.view-office .fullscreen-main-view--office:not(.fullscreen-main-view--office-national))>.topbar{height:84px;min-height:84px;grid-template-rows:minmax(0,1fr)}
}

/* Sprint 1B final real-device QA: keep the accepted HUD controls in one compact city row. */
@media(min-width:560px) and (max-width:850px){
 #app:has(>.world-main.view-city){--hub-topbar-space:67px}
 #app:has(>.world-main.view-city)>.topbar{height:67px;min-height:67px;padding:2px 8px;grid-template-rows:minmax(0,1fr)}
}

/* Phone ship detail owns the foreground; restore the city widgets when it closes. */
@media(max-width:600px){
 #app>.world-main.view-city:not(.has-place) .city-scene:has(.city-ship-detail-content) .city-info-details,
 #app>.world-main.view-city:not(.has-place) .city-scene:has(.city-ship-detail-content) .city-ship-switcher{display:none!important}
}
