/* A compact target card, placed in measured free space by pirate-layout.js. */
body[data-bridge="on"] #page#page .pirate-world-marker{left:var(--pirate-x,88%)!important;top:var(--pirate-y,25%)!important;width:100px!important;height:44px!important;min-width:0!important;min-height:0!important;padding:4px!important;box-sizing:border-box;display:grid!important;grid-template-columns:26px 1fr;grid-template-rows:1fr;gap:0 4px!important;align-items:center!important;border:1px solid #b58a5c99!important;border-radius:9px!important;background:#091b2ded!important;box-shadow:0 3px 10px #0008}
body[data-bridge="on"] #page#page .pirate-world-marker>img{width:26px!important;height:26px!important;grid-row:1}
body[data-bridge="on"] #page#page .pirate-world-marker>strong{font-size:10px!important;line-height:1.2!important;padding:0!important;border:0!important;background:none!important;white-space:nowrap}
body[data-bridge="on"] #page#page .pirate-world-marker>small{display:none!important;font-size:8px!important;line-height:1.2!important;padding:0!important;background:none!important;white-space:nowrap;max-width:none!important}
/* Commander cards never travel over the ships. */
.combat-roster{position:absolute;left:2%;bottom:2%;width:235px;z-index:95;pointer-events:auto;border:1px solid #78cdda88;border-radius:12px;background:#071b2be8;color:#edfaff;padding:8px;box-sizing:border-box;box-shadow:0 6px 18px #0007}
.combat-roster-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:5px}.combat-roster-head>b{font-size:11px}.combat-roster-head button{font-size:10px!important;min-height:32px;padding:4px 6px!important;background:#133549!important;border:1px solid #6db3c955!important;border-radius:7px}
.combat-person{display:flex;align-items:center;gap:7px;padding:6px 0;min-width:0;border-top:1px solid #8ac2cf25}.combat-person-you{color:#f6d99d}.combat-portrait{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0;border:1px solid #99e5f0}.combat-person>span{flex:1;min-width:0}.combat-person strong{display:block;font-size:13px;line-height:1.25;overflow-wrap:anywhere}.combat-person small{display:block;font-size:10px;color:#c3d8df;margin-top:3px}.combat-roster-ship{width:48px;height:35px;object-fit:contain;flex-shrink:0}.combat-roster-all{width:100%;min-height:34px!important;font-size:11px!important;padding:5px!important;margin-top:5px;border-radius:7px}
body[data-combat-portraits="names"] :is(.combat-roster,.combat-people-dialog) :is(.combat-portrait,.combat-roster-ship){display:none!important}
.combat-people-dialog{width:min(520px,94vw);max-height:85dvh;padding:16px;overflow:auto;border:1px solid #85d3df;border-radius:12px;background:#081e2ff5;color:#e7f7ff}.combat-people-dialog>header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;background:#081e2f;z-index:2}.combat-people-dialog h2{font-size:20px}.combat-people-dialog header button{width:44px;height:44px;font-size:24px}
body[data-bridge="on"] #page#page .combat-layout-active :is(.boss-route-avatar,.space-action-avatar){display:none!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-routes .boss-flying{display:none!important;width:76px!important;height:45px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;padding:0!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-routes .boss-flying.combat-flight-visible{display:block!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-flying>.boss-route-ship{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:contain!important;border-radius:0!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-flying :is(small,b){display:none!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-flight-paths{opacity:.24!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-core{left:42%!important;top:30%!important;width:64%!important;height:58%!important;max-width:none!important;max-height:100%!important;z-index:30!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-core .boss-shield{width:100%!important;height:calc(100% - 50px)!important}
body[data-bridge="on"] #page#page .combat-layout-active .boss-core .boss-shield>img{width:100%!important;height:100%!important;object-fit:contain!important}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-fleet :is(strong,small){display:none!important}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-fleet:not(.combat-flight-visible){display:none!important}
body[data-bridge="on"] #page#page .combat-layout-active>.system-position,body[data-bridge="on"] #page#page .combat-layout-active>.pirate-world-marker{opacity:.28}
@media(orientation:portrait){
 .combat-roster{width:170px;padding:6px;left:1%;bottom:2%}.combat-roster-head{align-items:flex-start}.combat-roster-head>b{font-size:10px;max-width:55px}.combat-roster-head button{font-size:9px!important;max-width:90px}.combat-portrait{width:34px;height:34px}.combat-roster-ship{width:34px;height:28px}.combat-person{gap:5px;padding:5px 0}.combat-person strong{font-size:11px}.combat-person small{font-size:9px}
 body[data-bridge="on"] #page#page .combat-layout-active .boss-core{left:42%!important;top:29%!important;width:80%!important;height:48%!important}
 body[data-bridge="on"] #page#page .combat-layout-active .boss-routes .boss-flying{width:54px!important;height:36px!important}
 body[data-bridge="on"] #page#page .combat-layout-active .space-action-enemy{width:74%!important;height:44%!important;max-height:100%!important;z-index:30!important}
 body[data-bridge="on"] #page#page .combat-layout-active .space-action-sector{width:44%!important;height:26%!important;max-height:100%!important;z-index:29!important}
 body[data-bridge="on"] #page#page .combat-layout-active .space-action-escort{width:27%!important;height:15%!important;max-height:100%!important;z-index:28!important}
}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-path{opacity:.26!important;stroke-width:1px!important}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-extra{display:none!important}
body[data-bridge="on"] #page#page .planet-map .map-fleet{display:none!important}
.route-fleet-badge>.route-ship{transform:rotate(var(--route-heading,0deg))!important}
/* Boss 1/2: centred target, separated commander origins, no map-covering roster. */
body[data-bridge="on"] #page#page .planet-map.boss-duel-active .boss-core{left:50%!important;top:50%!important;width:58%!important;height:52%!important;z-index:30!important;transform:translate(-50%,-50%)!important}
body[data-bridge="on"] #page#page .boss-duel-active .boss-core .boss-shield{height:calc(100% - 46px)!important}
body[data-bridge="on"] #page#page .boss-duel-active .boss-core strong{font-size:clamp(10px,1.8vw,16px)!important;max-width:100%;white-space:normal;text-align:center}
body[data-bridge="on"] #page#page .boss-duel-active .boss-core small{font-size:clamp(9px,1.3vw,12px)!important}
.boss-origin{position:absolute!important;transform:translate(-50%,-50%)!important;display:flex!important;flex-direction:column;align-items:center;gap:3px;width:92px!important;padding:0!important;background:transparent!important;border:0!important;z-index:70;pointer-events:auto;min-height:0!important;color:white!important}
.boss-origin img{display:block!important;width:48px!important;height:48px!important;border-radius:50%;object-fit:cover;border:2px solid #8cdce8;box-shadow:0 0 12px #46c9e84d}.boss-origin strong{display:block!important;max-width:100%;font-size:11px!important;line-height:1.2;background:#071a28ed;border:1px solid #5992a555;border-radius:6px;padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-combat-portraits="names"] .boss-origin img{display:none!important}
body[data-bridge="on"] #page#page .boss-duel-active .boss-flight-paths{opacity:.75!important}.boss-duel-active .boss-route-stream{stroke-width:1.8!important}
.helm-right-display .combat-roster{position:relative!important;inset:auto!important;width:100%!important;z-index:4;margin:0;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}.combat-roster-open{width:100%;min-height:38px!important;font-size:12px!important;background:#102e3ed9!important;border:1px solid #75c7d7!important;border-radius:8px!important;padding:6px!important;color:#e5f8ff!important}
body[data-bridge="on"] #page#page .boss-duel-active>:is(.system-position,.pirate-world-marker,.route-fleet-badge){opacity:.13!important}.boss-duel-active .boss-component-layer{opacity:.65}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-enemy{width:48%!important;height:40%!important;z-index:30!important}body[data-bridge="on"] #page#page .combat-layout-active .space-action-sector{width:35%!important;height:30%!important;z-index:29!important}body[data-bridge="on"] #page#page .combat-layout-active .space-action-escort{width:19%!important;height:20%!important;z-index:28!important}
@media(orientation:portrait){body[data-bridge="on"] #page#page .planet-map.boss-duel-active .boss-core{width:67%!important;height:42%!important}.boss-origin{width:72px!important}.boss-origin img{width:40px!important;height:40px!important}.boss-origin strong{font-size:9px!important}body[data-bridge="on"] #page#page .combat-layout-active .space-action-enemy{width:58%!important;height:35%!important}body[data-bridge="on"] #page#page .combat-layout-active .space-action-sector{width:42%!important;height:28%!important}.combat-roster-open{font-size:11px!important;min-height:32px!important}}
body[data-bridge="on"] #page#page .boss-duel-active .boss-core .boss-shield{height:100%!important}body[data-bridge="on"] #page#page .boss-duel-active .boss-core>strong{position:absolute;top:100%;left:50%;transform:translateX(-50%);width:max-content;max-width:130%}body[data-bridge="on"] #page#page .boss-duel-active .boss-core>.boss-health{position:absolute;top:calc(100% + 27px)}body[data-bridge="on"] #page#page .boss-duel-active .boss-core>small{position:absolute;top:calc(100% + 38px);white-space:nowrap}
body[data-bridge="on"] #page#page .combat-layout-active .space-action-fleet .space-action-avatar{display:block!important;width:34px!important;height:34px!important;position:absolute;left:-14px;top:-26px;border:1px solid #99ddeb;border-radius:50%}body[data-bridge="on"] #page#page .combat-layout-active .space-action-fleet strong{display:block!important;position:absolute;top:100%;left:50%;transform:translateX(-50%);font-size:9px!important;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#081d2deb;padding:3px;border-radius:5px}body[data-combat-portraits="names"][data-bridge="on"] #page#page .combat-layout-active .space-action-fleet .space-action-avatar{display:none!important}
body[data-bridge="on"] .helm-right-display:has(.combat-roster){display:flex!important;flex-direction:column;justify-content:center;gap:3px}body[data-bridge="on"] .helm-right-display:has(.combat-roster)>.bridge-flight-status,body[data-bridge="on"] .helm-right-display:has(.combat-roster)>.bridge-operations-button{display:none!important}body[data-bridge="on"] .helm-right-display:has(.combat-roster)>#boss-announcement:not(.boss-event-active){display:none!important}.helm-right-display .combat-roster{flex:1;min-height:0;display:flex;align-items:stretch}.helm-right-display .combat-roster-open{min-height:0!important;flex:1;height:100%;line-height:1.2!important}.boss-origin strong{white-space:normal!important;overflow-wrap:anywhere;max-height:30px;overflow:hidden}@media(orientation:portrait){.boss-origin{width:86px!important}}

/* Own main ships retain their finish, portrait and support role in every battle. */
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-fleet:has([data-ship-paint]:not([data-ship-paint=""])){width:112px!important;height:80px!important;z-index:40!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-fleet>.space-action-avatar{display:block!important;inset:auto -8px auto auto!important;top:-12px!important;width:28px!important;height:28px!important;border:2px solid #bcecff!important;z-index:3!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-fleet :is(strong,small){display:block!important;max-width:150px!important;font-size:9px!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-enemy{left:50%!important;top:50%!important;max-width:none!important;width:46%!important;height:42%!important;z-index:30!important;transform:translate(-50%,-50%)!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-enemy :is(strong,small){z-index:4!important;display:block!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-escort{width:17%!important;height:18%!important;z-index:32!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .boss-flying:has([data-ship-paint]:not([data-ship-paint=""])){width:112px!important;height:80px!important;z-index:40!important}
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .boss-flying small{display:block!important;position:absolute;top:100%;font-size:9px!important;white-space:nowrap;background:#041521e8;padding:3px;border-radius:4px}
@media(orientation:portrait){body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-enemy{width:66%!important;height:34%!important}body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-escort{width:23%!important;height:13%!important}body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-fleet:has([data-ship-paint]:not([data-ship-paint=""])){width:88px!important;height:64px!important}}

/* Centre the personal hull on the actual flight marker at every screen size. */
body[data-bridge="on"] #page#page .planet-map.combat-layout-active .space-action-fleet>.space-action-ship[data-ship-paint]:not([data-ship-paint=""]){inset:0!important;width:100%!important;height:100%!important;transform:none!important}

/* Fleet hulls and commander labels remain visible in portrait and landscape. */
body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying,body[data-bridge="on"] #page#page .planet-map .space-action-fleet{display:block!important;width:clamp(68px,8cqw,115px)!important;height:clamp(44px,9cqh,75px)!important;transform:translate(-50%,-50%)!important;z-index:44!important;overflow:visible!important;opacity:1!important;background:transparent!important;border:0!important;box-shadow:none!important;transition:left .12s linear,top .12s linear}
body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying>.boss-route-ship,body[data-bridge="on"] #page#page .planet-map .space-action-fleet>.space-action-ship{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:30px!important;max-height:none!important;opacity:1!important;object-fit:contain!important;transform:scaleX(var(--route-facing,1))!important;rotate:none!important}
body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying>.boss-moving-avatar,body[data-bridge="on"] #page#page .planet-map .space-action-fleet>.space-action-avatar{display:block!important;position:absolute!important;inset:auto -4px auto auto!important;top:-12px!important;width:26px!important;height:26px!important;max-width:26px!important;max-height:26px!important;object-fit:cover!important;border:1px solid #9de4f5!important;border-radius:50%!important;transform:none!important;z-index:4!important}
body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying :is(small,b),body[data-bridge="on"] #page#page .planet-map .space-action-fleet :is(strong,small){display:block!important;position:absolute!important;left:50%!important;top:100%!important;bottom:auto!important;transform:translateX(-50%)!important;max-width:150px!important;width:max-content!important;margin:0!important;padding:2px 4px!important;background:#061927ee!important;border-radius:4px!important;color:#e8faff!important;font:10px/1.2 system-ui!important;white-space:nowrap!important;opacity:1!important;overflow:hidden!important;text-overflow:ellipsis!important}
body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying b,body[data-bridge="on"] #page#page .planet-map .space-action-fleet small{margin-top:16px!important;color:#a6eafa!important;font-size:9px!important}
@media(orientation:portrait){body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flying,body[data-bridge="on"] #page#page .planet-map .space-action-fleet{width:76px!important;height:48px!important}body[data-bridge="on"] #page#page .planet-map .boss-routes .boss-flight-you,body[data-bridge="on"] #page#page .planet-map .space-action-your-fleet{width:96px!important;height:62px!important}}

body[data-bridge="on"] #page#page .planet-map .route-fleet-badge>.route-commander{display:block!important;position:absolute!important;inset:auto -3px auto auto!important;top:-9px!important;width:24px!important;height:24px!important;border-radius:50%!important;object-fit:cover!important;transform:none!important;z-index:4!important}body[data-bridge="on"] #page#page .planet-map .route-fleet-badge>.route-commander-name{display:block!important;position:absolute;top:100%;left:50%;transform:translateX(-50%);width:max-content;max-width:140px;background:#061927ee;color:#e8faff;padding:2px 4px;border-radius:4px;font:10px/1.2 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body[data-bridge="on"] #page#page .planet-map .route-fleet-badge>small{margin-top:16px!important}

body[data-bridge="on"] #page#page .planet-map :is(.boss-flying,.space-action-fleet) :is(small,b,strong){max-width:190px!important}body[data-bridge="on"] #page#page .planet-map .route-fleet-badge>[data-route-eta]{position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:32px;padding:2px 4px;background:#061927ee;color:#ade9f5;border-radius:4px;font:9px/1.2 system-ui;white-space:nowrap}.helm-right-display .flight-quick-times{position:relative;z-index:4;display:grid;gap:3px;max-height:88px;overflow:auto;padding:4px 6px;background:#061a2cd9;border:1px solid #78c5df66;border-radius:5px;min-width:0;flex:none}.flight-quick-times>div{display:grid;gap:1px}.flight-quick-times strong{font:10px/1.2 system-ui;color:#ebf9ff}.flight-quick-times span{font:10px/1.2 system-ui;color:#b6eaf7;font-variant-numeric:tabular-nums}

.helm-right-display .flight-quick-times>button{display:block!important;min-height:26px!important;padding:4px 6px!important;color:#d5f5ff!important;background:#16394ee8!important;border:1px solid #79c4df88!important;border-radius:5px;font:10px/1.2 system-ui!important;cursor:pointer}.boss-colony-title>b{white-space:normal;max-width:230px;text-align:right;font-size:12px}.boss-community-lane>div:first-child{flex-wrap:wrap;gap:5px}.boss-community-lane small{white-space:normal!important}
/* Stable-width countdowns prevent label jitter. Landscape system stays readable. */
[data-boss-flight-time],[data-space-flight-time],[data-route-eta]{font-variant-numeric:tabular-nums!important;min-width:9ch;text-align:center}
@media(orientation:landscape) and (max-height:550px){
body[data-bridge="on"] #page[data-game-view="traffic"] .bridge-sheet{inset:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left))!important;width:auto!important;max-width:none!important;height:auto!important;max-height:calc(100dvh - 16px)!important;overflow-y:auto!important;padding:12px!important;border-radius:12px!important}
body[data-bridge="on"] #page[data-game-view="traffic"] .bridge-sheet-close{position:sticky!important;top:0!important;float:right;z-index:20;min-width:40px;min-height:40px}.boss-colony-card{padding:10px!important}.boss-colony-title{gap:8px}.boss-colony-title>b{font-size:13px;white-space:nowrap}.boss-colony-journey{margin:12px 0!important;min-height:44px}.boss-community-lanes{max-height:none!important;overflow:visible!important}.boss-community-lane{padding:8px!important;min-height:76px}.boss-community-lane small{font-size:12px!important}.boss-community-route{margin-top:12px!important}.boss-community-lane>div:first-child{align-items:center}.boss-community-head{font-size:13px}.helm-right-display .flight-quick-times{max-height:96px}.flight-quick-times span{font-size:11px}
}

/* Modal has one fixed header and one scrolling list, isolated from cockpit banners. */
body[data-bridge="on"] dialog.combat-people-dialog[open]{position:fixed!important;inset:0!important;margin:auto!important;width:min(560px,94vw)!important;height:min(600px,88dvh)!important;max-width:94vw!important;max-height:88dvh!important;display:flex!important;flex-direction:column!important;gap:8px!important;overflow:hidden!important;padding:12px!important;box-sizing:border-box!important;transform:none!important;background:#081c2bf5!important;border:1px solid #85d3df!important;border-radius:12px!important;box-shadow:0 16px 60px #000b!important;color:#e7f7ff!important}
body[data-bridge="on"] dialog.combat-people-dialog>header{position:static!important;inset:auto!important;display:flex!important;flex:none!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;width:100%!important;height:auto!important;min-height:44px!important;max-height:none!important;margin:0!important;padding:0 0 8px!important;transform:none!important;background:transparent!important;border:0!important;border-bottom:1px solid #739cb44d!important;box-shadow:none!important;overflow:visible!important}
body[data-bridge="on"] dialog.combat-people-dialog>header h2{position:static!important;inset:auto!important;margin:0!important;padding:0!important;font:700 19px/1.2 system-ui!important;color:#e7f7ff!important;transform:none!important}
body[data-bridge="on"] dialog.combat-people-dialog>header button{position:static!important;inset:auto!important;flex:0 0 44px!important;width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;transform:none!important;font:24px/1 system-ui!important;background:#143647!important;border:1px solid #76bbcc!important;border-radius:8px!important}
body[data-bridge="on"] dialog.combat-people-dialog>[data-combat-toggle]{flex:none!important;align-self:flex-start!important;min-height:36px!important;padding:5px 10px!important;font:12px/1.2 system-ui!important}
body[data-bridge="on"] dialog.combat-people-dialog>.combat-people-list{position:relative!important;flex:1!important;min-height:0!important;overflow:auto!important;overscroll-behavior:contain!important;touch-action:pan-y!important;padding:0 4px!important}
body[data-bridge="on"] dialog.combat-people-dialog .combat-person{min-height:58px!important;gap:10px!important;padding:8px 0!important}.combat-people-dialog .combat-portrait{width:40px!important;height:40px!important}.combat-people-dialog .combat-person strong{font:600 13px/1.25 system-ui!important}.combat-people-dialog .combat-person small{font:11px/1.3 system-ui!important}
@media(orientation:landscape) and (max-height:550px){body[data-bridge="on"] dialog.combat-people-dialog[open]{width:min(740px,94vw)!important;height:94dvh!important;max-height:94dvh!important;padding:8px 12px!important;gap:4px!important}body[data-bridge="on"] dialog.combat-people-dialog>header{min-height:40px!important;padding-bottom:4px!important}body[data-bridge="on"] dialog.combat-people-dialog>header h2{font-size:17px!important}body[data-bridge="on"] dialog.combat-people-dialog .combat-person{min-height:54px!important;padding:6px 0!important}}
