/* One bounded frame: 56px top cells, 148px left rail, 220px right rail. */
:root{--hud-height:56px;--hud-gap:10px;--hud-edge:16px;--hud-left:148px;--hud-right:220px}
#game .topbar{top:var(--hud-edge);left:var(--hud-edge);right:calc(var(--hud-right) + var(--hud-edge) + var(--hud-gap));height:var(--hud-height);display:flex;gap:var(--hud-gap);align-items:stretch;z-index:8;padding:0;pointer-events:none}
#game .topbar>*{pointer-events:auto}.topbar .settings-button{width:40px;min-width:40px;height:40px;font-size:23px;border-radius:11px;align-self:center;margin-left:auto}
#kardashev.kardashev{flex:0 0 124px;width:124px;height:var(--hud-height);min-height:0;display:grid;grid-template-rows:12px 18px 11px;gap:2px;padding:5px 10px;border-radius:12px;border-width:1px;text-align:left;align-items:center}
.k-title{font-size:10px;color:#bad4e5;font-weight:800;letter-spacing:0}.k-meter{display:flex;gap:8px;align-items:center}.k-meter>b{font-size:14px;font-variant-numeric:tabular-nums}.k-meter>.progress{width:100%;height:4px;border:0;margin:0}.kardashev #k-scope{display:block;font-size:9px;color:#a3c6d4;line-height:1;letter-spacing:0}
#resources.resourcebar{display:flex;gap:8px;align-items:stretch;overflow:visible;padding:0;min-width:0;flex:1;justify-content:flex-start}
#resources .resource-chip{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;padding:7px 12px 7px 8px;width:auto;min-width:92px;max-width:142px;flex:0 1 auto;height:var(--hud-height);min-height:0;border:1px solid #5490ab99;border-radius:12px;background:linear-gradient(135deg,#173b50f5,#0d283de8);box-shadow:0 3px 9px #061c3155;cursor:pointer;overflow:visible}
#resources .resource-chip .hud-icon{width:28px;height:36px;flex:0 0 28px;margin:0}#resources .resource-text{min-width:0;margin:0;padding:0}#resources .resource-text>strong{display:block;white-space:nowrap;font-size:17px;letter-spacing:-.3px;line-height:1.15;font-variant-numeric:tabular-nums}
#resources .resource-name,#resources .resource-text>small,#resources .resource-text>strong em,#resources .resource-density{display:none!important}
#resources .resource-plus{position:absolute;right:-5px;top:-5px;display:grid;place-items:center;min-width:22px;width:22px;height:22px;border-radius:7px;border:1px solid #abf3a2;background:linear-gradient(#7bc760,#379446);padding:0;font-size:18px;line-height:1;box-shadow:0 2px 4px #06243866;z-index:2}
#resources .resource-chip.resource-compact{flex:0 0 56px;min-width:56px;width:56px;padding:4px;gap:0;flex-direction:column}#resources .resource-compact .hud-icon{width:24px;height:26px;flex:0 0 26px}#resources .resource-compact .resource-text>strong{font-size:12px}
.resource-alert{display:none}#resources .resource-chip[data-warning="true"]{border-color:#f6b779;background:linear-gradient(135deg,#705039f5,#47323aed)}#resources .resource-chip[data-warning="true"] .resource-alert{display:grid;place-items:center;position:absolute;left:-4px;top:-5px;width:17px;height:17px;border-radius:50%;background:#edaa5c;color:#2d2430;font-size:12px;font-weight:900}
#resources .delivery-icon,#resources .frontier-resource-icon{font-size:26px;margin:0}#resources .delivery-link{display:none}.resource-overflow-button{display:none}
.hud-tooltip{position:fixed;z-index:100;max-width:260px;background:#13334cf5;border:1px solid #598ba3;border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.5;color:#d0e9f6;box-shadow:0 6px 18px #041a3366;pointer-events:none}
#game>#region-nav{top:calc(var(--hud-edge) + var(--hud-height) + 10px);left:var(--hud-edge);width:var(--hud-left);display:grid;grid-template-columns:1fr;padding:4px;gap:2px;border-radius:12px;border-width:1px}
#region-nav button{padding:6px 8px;gap:8px;min-height:32px;border-radius:8px}#region-nav button>span:nth-child(2){font-size:11px}#region-nav small{display:none}#region-nav .region-orb,#region-nav .worlds-symbol{width:22px;height:22px;font-size:22px}
#game>#activity{top:202px;left:var(--hud-edge);width:var(--hud-left);max-height:calc(100dvh - 340px);overflow:auto;padding:0;z-index:7}.activity-heading{display:none}.activity-list{display:flex;flex-direction:column;gap:10px;overflow:visible;padding:0}.activity-group-name{display:block;font-size:10px;font-weight:800;color:#e1f5fa;text-shadow:0 1px 4px #001822;margin:0 0 3px}.activity-group-items{display:flex;flex-wrap:wrap;gap:4px}.activity-project{width:44px;height:48px;min-height:0;border-radius:9px;background:#12314880;padding:1px;border:1px solid #517c8b66}.activity-project .activity-art,.activity-project .activity-art .sprite{width:40px;height:40px}.activity-project>.progress{left:3px;right:3px;bottom:3px;width:auto;height:4px}.activity-project.blocked{background:#7f4e34c9;border-color:#efab66}.activity-project.blocked>.progress>i{background:#f2b85e}.activity-project .activity-content,.activity-project .activity-arrow{display:none}.activity-state{top:-3px;right:-2px;font-size:10px;width:14px;height:14px;line-height:14px}
#game>#objective-button.macro-milestone{top:var(--hud-edge);right:var(--hud-edge);width:var(--hud-right);height:var(--hud-height);min-height:0;padding:8px 10px 11px;gap:8px;border-radius:12px}.macro-milestone .macro-symbol{font-size:22px!important}.macro-milestone #objective-title{font-size:12px;margin:0;line-height:1.25}.macro-milestone #objective-count{font-size:9px;line-height:1.3;margin-top:3px}.macro-milestone .chevron{font-size:18px!important}
#game>.objective-card{top:calc(var(--hud-edge) + var(--hud-height) + 10px)!important;right:var(--hud-edge);width:var(--hud-right);max-height:260px;overflow:auto;padding:10px;border-radius:12px;border-width:1px}.objective-card #objective-description,.objective-card .suggestion-heading,.objective-card #fuel-outlook{display:none}.objective-card .suggestion-art{margin:0 0 6px;gap:8px}.objective-card .suggestion-art>.sprite{width:36px;height:36px}.objective-card .suggestion-art>span{font-size:12px}.objective-card .other-actions{display:flex;gap:5px;flex-wrap:wrap}.objective-card .other-actions>small{display:none}.objective-card .other-actions .grow-income{font-size:10px;margin:0;padding:5px}.objective-card .action-button{padding:7px 9px;min-height:30px;font-size:11px}.objective-card p{margin:5px 0;font-size:10px}.objective-card [data-suggestion-reason]{font-size:10px}.objective-card .cost-row{margin:6px 0}.objective-card .cost-row .progress{height:3px}
#game>.bottom-left{left:var(--hud-edge);bottom:var(--hud-edge);gap:6px;z-index:8}.bottom-left .nav-tile{width:66px;height:62px;min-height:0;border-radius:12px;padding:6px 4px;font-size:10px;border-width:1px;gap:3px}.bottom-left .nav-art,.bottom-left .nav-icon{width:30px;height:30px}.bottom-left .expansion-nav-art{height:30px;font-size:27px;line-height:30px}.bottom-left .badge{width:15px;height:15px;font-size:9px;top:-4px;right:-3px}
#game>.time-panel{right:var(--hud-edge);bottom:var(--hud-edge);width:168px;padding:8px 10px;border-radius:12px;border-width:1px}.time-panel .time-heading{font-size:9px}.time-panel .speed-controls{margin:5px 0;gap:4px}.time-panel .speed-controls button{height:25px;padding:3px;font-size:11px}.time-panel .clock-row{font-size:8px}.time-panel #pause-button{width:25px;height:25px;font-size:15px}.time-panel .live-dot{display:none}
#game>#overdrive{right:var(--hud-edge);bottom:130px;width:168px;padding:9px;border-radius:12px;border-width:1px}#overdrive .overdrive-heading{font-size:8px}#overdrive .action-button{font-size:10px;padding:7px}#overdrive #overdrive-status{display:none}#game>.world-hint{display:none}#game>.map-controls{bottom:var(--hud-edge);left:50%;padding:3px;border-radius:10px;border-width:1px}.map-controls small{display:none}.map-controls button{width:28px;height:29px;font-size:18px}.map-controls #map-zoom-value{font-size:10px;min-width:35px}.region-caption{display:none!important}
@media(min-width:801px) and (max-width:1100px){:root{--hud-left:112px;--hud-right:190px;--hud-edge:12px;--hud-gap:8px}#kardashev.kardashev{flex-basis:100px;width:100px;padding:5px 8px}#resources.resourcebar{gap:6px}#resources .resource-chip{min-width:74px;padding:6px;gap:4px}#resources .resource-chip .hud-icon{width:21px;flex-basis:21px}#resources .resource-text>strong{font-size:14px}.topbar .settings-button{width:30px;min-width:30px;font-size:20px}.activity-project{width:48px}}
@media(max-width:800px),(pointer:coarse) and (max-height:500px){
  :root{--hud-height:48px;--hud-edge:10px;--hud-left:98px;--hud-right:190px;--hud-gap:8px}
  #game>.topbar{display:flex!important;top:calc(env(safe-area-inset-top,0px) + 10px);left:10px;right:10px;height:calc(var(--resource-rows,1) * 54px - 6px);pointer-events:none;overflow:visible}
  #game .topbar>.settings-button{display:none}.topbar>#resources.resourcebar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%;overflow:visible;align-content:start;pointer-events:none}
  #resources .resource-chip,#resources .resource-chip.resource-compact{pointer-events:auto;min-width:0;max-width:none;width:auto;height:48px;min-height:48px;flex:auto;display:flex;flex-direction:row;padding:6px;gap:5px;border-radius:10px}
  #resources .resource-chip .hud-icon,#resources .resource-chip.resource-compact .hud-icon{width:23px;height:28px;flex:0 0 23px}#resources .resource-text>strong,#resources .resource-compact .resource-text>strong{font-size:12px;letter-spacing:-.3px}
  #resources .resource-plus{min-width:18px;min-height:18px;width:18px;height:18px;right:-3px;top:-3px;font-size:15px;border-radius:5px}
  #resources .resource-chip.hud-overflow{display:none!important}#resources .resource-overflow-button:not([hidden]){display:block;pointer-events:auto;height:48px;font-size:24px;border-radius:10px}
  #resources .delivery-icon{font-size:20px}#resources .resource-alert{width:15px;height:15px;font-size:10px}
  #kardashev.kardashev{position:absolute;left:0;top:calc(var(--resource-rows,1) * 54px + 3px);width:98px;height:56px;padding:6px 8px;grid-template-rows:11px 17px 10px;border-radius:10px;pointer-events:auto}.k-title{font-size:9px}.k-meter>b{font-size:13px}.kardashev #k-scope{font-size:9px}
  .mobile-hud{--edge:10px}.mobile-hud .panel{border-radius:10px}.mobile-context-row{left:10px;right:10px;top:calc(env(safe-area-inset-top,0px) + var(--resource-rows,1) * 54px + 13px);display:block}
  .mobile-context-row .mobile-world{position:absolute;left:0;top:62px;width:98px;min-height:36px;height:36px;padding:5px 7px;gap:4px}.mobile-world b{font-size:10px}.mobile-world span{font-size:12px}
  .mobile-context-row .mobile-goal{margin-left:108px;height:56px;padding:8px 9px 12px;justify-content:center;min-height:0;max-height:56px}.mobile-goal b{font-size:11px;white-space:normal;line-height:1.3;text-overflow:clip}
  .mobile-action-row{top:calc(env(safe-area-inset-top,0px) + var(--resource-rows,1) * 54px + 77px);bottom:auto;left:118px;right:10px;display:block}.mobile-action-row>button:first-child{height:auto;min-height:42px;padding:8px;gap:5px}.mobile-action-row>button:first-child>span{font-size:15px}.mobile-action-row>button:first-child>b{font-size:10px;line-height:1.3}.mobile-action-row>button:nth-child(2){display:none}
  #game>#activity{display:block!important;top:calc(env(safe-area-inset-top,0px) + var(--resource-rows,1) * 54px + 121px);left:10px;width:98px;max-height:calc(100dvh - var(--resource-rows,1) * 54px - 268px);z-index:7}#game>#activity[hidden]{display:none!important}.activity-group-items{gap:4px}.activity-project{width:44px;height:46px}.activity-group-name{font-size:9px}.activity-list{gap:7px}
  .mobile-dock{bottom:calc(env(safe-area-inset-bottom,0px) + 10px);left:10px;right:10px;padding:3px;gap:2px;height:57px}.mobile-dock button{height:49px;min-height:44px;font-size:9px;gap:1px;border-radius:8px}.mobile-dock .nav-art,.mobile-dock .nav-icon{width:25px;height:25px;line-height:25px}.mobile-dock button>span{font-size:24px;line-height:24px}.mobile-dock small{font-size:7px;top:2px;right:2px}
  #game>.map-controls{left:auto;right:10px;bottom:calc(env(safe-area-inset-bottom,0px) + 77px);height:36px;padding:1px;border-radius:9px;transform:none}.map-controls button{width:33px;height:33px;font-size:20px}.map-controls #map-zoom-value{font-size:10px;min-width:34px}
  #modal>.modal-header{height:calc(58px + env(safe-area-inset-top,0px));min-height:calc(58px + env(safe-area-inset-top,0px));padding:calc(8px + env(safe-area-inset-top,0px)) 64px 8px 14px;gap:9px}#modal .modal-header h1{font-size:21px}#modal #close-modal{top:calc(7px + env(safe-area-inset-top,0px));right:9px;width:44px;height:44px;min-width:44px;min-height:44px;font-size:28px}#modal .modal-emblem,#modal .modal-emblem .nav-icon{width:27px;height:30px;font-size:26px}
  #modal>#modal-body{padding:12px 12px calc(16px + env(safe-area-inset-bottom,0px))}#modal .edge-sheet>.resourcebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:4px}
  #modal .edge-sheet #resources .resource-chip{display:grid!important;grid-template-columns:28px 1fr;align-items:center;gap:8px;width:100%;height:auto;min-height:90px;max-width:none;padding:12px 10px;background:#15364f;pointer-events:auto}#modal .edge-sheet #resources .resource-chip .resource-text{display:block;min-width:0}#modal .edge-sheet #resources .resource-name{display:block!important;font-size:10px;line-height:1.3;white-space:normal;color:#b6d4e5}#modal .edge-sheet #resources .resource-text>strong{font-size:17px;margin:4px 0}#modal .edge-sheet #resources .resource-text>small{display:block!important;font-size:10px;line-height:1.4;white-space:normal;max-height:none}#modal .edge-sheet #resources .resource-plus{width:24px;height:24px;min-height:24px;font-size:19px}#modal .edge-sheet .resource-overflow-button{display:none!important}
  #modal .edge-sheet #activity{padding:0;display:block}#modal .edge-sheet .activity-list{display:flex;gap:16px}#modal .edge-sheet .activity-group-name{font-size:13px;margin-bottom:7px}#modal .edge-sheet .activity-group-items{display:grid;grid-template-columns:1fr;width:100%;gap:8px}#modal .edge-sheet .activity-project{grid-template-columns:42px 1fr;min-height:78px;padding:9px 10px 19px;gap:9px;border-radius:10px}#modal .edge-sheet .activity-content>strong{font-size:12px}#modal .edge-sheet .activity-kind{display:none}#modal .edge-sheet .activity-meta,#modal .edge-sheet .activity-eta{font-size:10px}
  #modal .edge-sheet>.panel{padding:10px;margin-bottom:10px}.hud-tooltip{display:none!important}
}
@media(max-width:374px){.topbar>#resources.resourcebar{grid-template-columns:repeat(3,minmax(0,1fr))}#resources .resource-text>strong{font-size:12px}.mobile-context-row .mobile-goal{margin-left:105px}.mobile-action-row{left:115px}}
@media(pointer:coarse) and (max-height:500px) and (min-width:601px){
  #game>.topbar{right:240px}.topbar>#resources.resourcebar{grid-template-columns:repeat(5,minmax(0,1fr))}#kardashev.kardashev{top:58px}.mobile-context-row{top:calc(env(safe-area-inset-top,0px) + 10px);left:auto;right:10px;width:220px}.mobile-context-row .mobile-goal{margin-left:0}.mobile-context-row .mobile-world{top:62px;width:98px}.mobile-action-row{top:78px;left:auto;right:10px;width:112px}.mobile-dock{left:auto;width:280px;height:57px}.mobile-action-row>button:first-child{min-height:44px}.mobile-dock button{font-size:9px}#game>#activity{top:130px;max-height:calc(100dvh - 205px)}#game>.map-controls{left:10px;right:auto;bottom:10px}
}
@media(min-width:801px){#game>#activity{top:216px}}
@media(max-width:800px),(pointer:coarse) and (max-height:500px){.mobile-context-row .mobile-goal{width:calc(100% - 108px)}.mobile-action-row>button:first-child{width:100%}}
@media(max-width:374px){.mobile-context-row .mobile-goal{width:calc(100% - 105px)}}
@media(pointer:coarse) and (max-height:500px) and (min-width:601px){.mobile-context-row .mobile-goal{width:100%}}
/* Queued/paused items keep the same footprint as active work. */
#game .activity-project,#game .activity-project.waiting{width:44px;height:48px;padding:1px;border-radius:9px;flex-shrink:0;background:#12314880}
#game .activity-project.blocked{background:#7f4e34c9;border-color:#efab66}
@media(max-width:800px),(pointer:coarse) and (max-height:500px){#game .activity-project,#game .activity-project.waiting{height:46px}}
#resources .fallback-icon{font-size:22px;line-height:1;color:#a7e7ee;overflow:visible}
@media(max-width:800px),(pointer:coarse) and (max-height:500px){#game:not([data-region="earth"]) #resources .delivery-chip{grid-column:auto;gap:4px;padding:6px;height:48px}#game:not([data-region="earth"]) #resources .delivery-chip .resource-text{display:block;width:auto}#game:not([data-region="earth"]) #resources .delivery-chip .resource-text>strong{font-size:12px}#resources .fallback-icon{font-size:21px}}
/* Completion lives in the milestone control; a second map banner obscures facilities. */
#game>#completion{display:none!important}
#modal .edge-sheet .activity-project{width:100%}
#modal .edge-sheet .activity-project .activity-content{display:block}
.mobile-goal #mobile-goal-stat{font-size:9px;line-height:1.1;letter-spacing:0;color:#add2e5;margin-top:3px;white-space:nowrap}
.macro-milestone .macro-symbol .sprite,.macro-milestone .macro-symbol .hud-icon{width:30px;height:32px}
@media(min-width:801px) and (min-height:501px){
 #game>#region-nav{top:auto;bottom:90px;max-height:122px;overflow:auto}
 #game>#activity{top:84px;max-height:calc(100dvh - 310px)}
}
@media(pointer:coarse) and (max-height:500px) and (min-width:601px){
 #kardashev.kardashev{top:calc(var(--resource-rows,1) * 54px + 3px)}
 #game>#activity{top:calc(var(--resource-rows,1) * 54px + 80px);max-height:calc(100dvh - var(--resource-rows,1) * 54px - 140px)}
}
