/* The galaxy has its own world coordinates. HUD and sheets stay in screen space. */
.map-surface{position:absolute;inset:0;z-index:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.map-controls{z-index:3}
.map-surface.dragging{cursor:grabbing}
.planet-hotspot[hidden]{display:none}
.planet-hotspot{touch-action:none}
.map-wide .planet-label{display:none}
.map-wide .planet-hotspot:focus-visible .planet-label{display:block}
.mobile-stats,.mobile-market{display:none}
.recipe-flow{display:flex;align-items:center;justify-content:center;gap:14px;flex:1;min-height:110px;margin:16px 0 12px}
.recipe-inputs{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap}
.recipe-ingredient,.recipe-output{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:12px;font-variant-numeric:tabular-nums;color:#d3ecf8}
.recipe-ingredient i{color:#8cb5cc;margin-left:2px}
.recipe-flow>.icon{color:#79cdd7;width:24px}
.recipe-flow .resource-icon{width:55px;height:55px}
.production-card h3{margin-bottom:16px}
.tech-tree-viewport{overflow:auto;overscroll-behavior:contain}
@media(max-width:760px),(max-height:500px) and (pointer:coarse){
  :root{--accent:#80f4e8;--purple:#df9fde;--border:#6dadd32e}
  .world{position:fixed;inset:0;height:100dvh;min-height:0}
  .topbar{position:fixed;inset:0 0 auto;height:150px;padding:0;background:none;border:0;pointer-events:none;z-index:20}
  .brand,.online-dot,.sector-heading,.left-widgets,.market-widget,.status-bar,.map-tip{display:none}
  .currencies{position:absolute;left:12px;top:13px;display:flex;flex-direction:column;align-items:flex-start;gap:7px}
  .currency,.currency.credits,.currency.value{display:flex;gap:8px;min-width:0;height:27px}
  .currency small,.currency.dark small{display:none}
  .currency>.icon{width:24px;height:24px;stroke-width:1.6;filter:drop-shadow(0 0 4px #4bdbeb50)}
  .currency div>span,.currency.dark div>span{font-family:"Segoe UI",sans-serif;font-size:25px;line-height:1;font-weight:300;letter-spacing:.1px;text-shadow:0 2px 8px #02051e}
  .currency.value>.icon{color:#6ad8ff}
  .header-actions{position:absolute;right:8px;top:8px;display:grid;grid-template-columns:repeat(2,44px);gap:3px;pointer-events:auto}
  .header-actions>.icon-button,.header-actions>.icon-button:last-child{display:flex;width:44px;height:44px;color:#73deec}
  .header-actions .icon{width:31px;height:31px;stroke-width:1.5;filter:drop-shadow(0 0 3px #27dfff80)}
  .world-tools{right:8px;top:151px;display:flex;flex-direction:column;gap:10px;z-index:4}
  .world-tools .tool-button,.world-tools .tool-button:last-child{display:flex;width:44px;height:48px;border:0;background:none;padding:0;color:#93fff0;gap:0}
  .tool-button>.icon{width:34px;height:34px;stroke-width:1.8;filter:drop-shadow(0 0 4px #3be9d53b)}
  .tool-button>span{font-size:10px;line-height:14px}
  .world-tools [data-panel="missions"]>span{display:none}
  .planet-label{font-size:11px;letter-spacing:.2px;top:calc(100% - 4px)}
  .planet-label small{display:none}
  .planet-hotspot.hud-overlap .planet-label{visibility:hidden}
  .planet-hotspot.selected .planet-label small{display:block;font-size:9px;margin-top:4px;letter-spacing:.1px}
  .planet-index{font-size:8px;padding:1px 2px;vertical-align:1px}
  .bottom-nav{position:fixed;left:0;right:0;bottom:0;width:100%;height:64px;transform:none;display:flex;gap:0;justify-content:stretch;padding:4px 2px 3px;border-radius:0;border:0;border-top:1px solid #497aab45;background:linear-gradient(#0b1830,#040918);box-shadow:0 -7px 25px #03072250;z-index:40}
  .nav-item{flex:1;min-width:0;width:auto;height:57px;gap:3px;font-size:10px;border:0;border-radius:7px;color:#54889e;padding:3px 0}
  .nav-item>.icon{width:30px;height:30px;stroke-width:1.6}
  .nav-item.active{background:linear-gradient(#2157829c,#17395915);color:#88e9ff;box-shadow:none}
  .nav-item.active:after{bottom:0;width:24px;height:2px;background:#75edff}
  .nav-item kbd{display:none}
  .map-controls{position:absolute;right:8px;bottom:76px;gap:0;padding:2px 3px;background:#08172bab;border:1px solid #69bfd72b;border-radius:12px;z-index:3}
  .map-controls .icon-button{width:40px;height:40px;color:#9edbee}
  .map-controls .icon-button .icon{width:20px;height:20px}
  .map-controls>span{font-size:11px;min-width:36px;text-align:center}
  .map-controls .map-controls-line{min-width:1px;margin:0 2px}
  .sheet-scrim{display:none}
  .sheet{left:0;bottom:64px;width:100%;height:51%;max-height:calc(100% - 100px);transform:none;border-radius:16px 16px 0 0;border:1px solid #6084b969;border-bottom:0;background:linear-gradient(145deg,#152344f5,#0e1030f2);box-shadow:0 -5px 24px #03072555;backdrop-filter:blur(7px)}
  .sheet-header{padding:7px 12px 6px 16px;min-height:52px;flex-shrink:0;border-bottom:1px solid #8abcdf21}
  .sheet-header h2{font-size:23px;font-weight:650;margin:0;color:#f1faff;letter-spacing:.4px}
  .sheet-header .eyebrow,.sheet-header .live-status{display:none}
  .sheet-header .icon-button{width:44px;height:38px;color:#cceaff}
  .sheet-header .icon-button .icon{width:25px;height:25px}
  .sheet-content{padding:0 12px 18px;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
  .sheet .button,.modal-body .button{min-height:44px;font-size:12px}
  .tabs{display:flex;gap:0;min-height:48px;flex-shrink:0}
  .tabs button{flex:1;justify-content:center;white-space:nowrap;min-height:48px;font-size:15px;font-weight:600;padding:12px 8px;gap:6px}
  .tabs .icon{width:17px;height:17px}
  .production-sheet .production-heading{display:none}
  .production-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 0}
  .production-card,.add-production{min-width:0;min-height:245px;padding:13px 11px 12px;border-radius:20px;border:1px solid #65bbd14d;background:radial-gradient(ellipse at 60% 75%,#286685,#173b57 90%);box-shadow:0 4px 0 #050920ba}
  .card-eyebrow{font-size:9px;letter-spacing:.7px;display:flex;flex-direction:column;align-items:flex-start;gap:5px}
  .card-eyebrow>span:last-child{font-size:8px;color:#94c4d7;letter-spacing:0}
  .recipe-flow{gap:4px;min-height:93px;margin:10px 0 6px}
  .recipe-inputs{gap:7px 4px;flex:1;min-width:0}
  .recipe-ingredient{min-width:39px;gap:1px;font-size:11px}
  .recipe-output{gap:1px;font-size:14px}
  .recipe-flow .resource-icon{width:43px;height:43px}
  .recipe-flow>.icon{width:17px;height:17px;flex-shrink:0}
  .production-card h3{font-size:13px;text-align:center;margin-bottom:12px;color:#e4f9ff}
  .production-card .progress{height:8px;background:#031221;border:1px solid #091524;margin:0}
  .production-card .progress i{background:#33d8fc}
  .production-timer{font-size:12px;display:flex;flex-direction:column;gap:3px;align-items:center;margin:6px 0 12px}
  .production-timer>span:last-child{font-size:10px;color:#a6cbdd}
  .card-actions{gap:5px;margin-top:auto}
  .card-actions .button{min-width:0;padding:6px;font-size:11px;border-radius:20px}
  .card-actions .primary-outline{border:2px solid #27cfee;color:#e6ffff}
  .card-actions .subtle{min-width:30px;width:30px;border:0;background:none;color:#89bacc}
  .card-actions .icon{width:16px;height:16px}
  .add-production{min-height:245px;gap:12px}
  .add-production>.icon{width:44px;height:44px;color:#38d5f1}
  .add-production h3{font-size:15px}
  .add-production p{font-size:11px;line-height:1.5}
  .empty-recipe h3{font-size:14px}
  .empty-recipe p{font-size:11px}
  .planet-detail{left:0;right:0;top:auto;bottom:64px;width:100%;max-height:51%;padding:7px 16px 0;border-radius:16px 16px 0 0;background:linear-gradient(145deg,#15314bf7,#101733f7);border-color:#688fbc6b;touch-action:pan-y;overscroll-behavior:contain;z-index:6}
  .planet-detail .small-button{width:44px;height:36px}
  .planet-detail .small-button .icon{width:22px;height:22px}
  .planet-title h2{font-size:25px}
  .planet-description{font-size:11px;padding-right:76px}
  .panel-topline .eyebrow{font-size:10px}
  .status-tag{font-size:8px}
  .planet-showcase{top:44px;width:76px;height:76px}
  .planet-showcase>img{height:85px;width:85px}
  .planet-resources thead th{font-size:8px}
  .planet-resources tbody th span:not(.resource-icon),.planet-resources td{font-size:12px}
  .planet-resources tbody th small{font-size:10px}
  .composition-heading>span:last-child,.composition .section-label{font-size:9px}
  .planet-resources .resource-icon{width:29px;height:29px}
  .shipment-line,.shipment-line strong,.shipment-line i{font-size:11px}
  .upgrade-heading .section-label{font-size:9px}
  .segmented button{font-size:11px;min-width:36px;min-height:34px}
  .upgrade-row{min-height:44px}
  .upgrade-copy strong{font-size:13px}.upgrade-copy small{font-size:10px}.upgrade-copy>span{font-size:12px}
  .upgrade-price{min-height:44px!important;font-size:13px!important}
  .manager-slot{min-height:50px;font-size:13px}.manager-slot small{font-size:10px}
  .planet-bottom{font-size:11px;min-height:48px}.planet-bottom button{min-height:44px}
  .managers-sheet,.settings-sheet,.help-sheet,.stats-sheet{height:calc(100% - 64px);max-height:calc(100% - 64px);border-radius:0}
  body:has(.managers-sheet,.settings-sheet,.help-sheet,.stats-sheet) .topbar{visibility:hidden}
  .manager-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .manager-card{padding:13px 10px;border-radius:15px;background:linear-gradient(#163b68,#284873);border-color:#9082ca8a;min-width:0}
  .manager-top{flex-direction:column;text-align:center;gap:9px}.manager-top h3{font-size:14px}.manager-top small{font-size:7px}
  .manager-bonus{font-size:11px;gap:4px}.manager-bonus.secondary{font-size:10px;line-height:1.5}
  .manager-select>span{font-size:7px;letter-spacing:0}.manager-select select{font-size:12px;min-height:42px;width:100%}
  .manager-card .button{font-size:10px;gap:5px;padding:5px}
  .research-sheet .section-intro{display:none}
  .research-sheet .content-toolbar{gap:4px;margin-bottom:8px}.research-sheet .content-toolbar>.muted{font-size:10px}
  .tech-tree-viewport{touch-action:pan-x pan-y;margin:0 -4px;padding:8px 4px 12px}
  .tech-tree{width:620px;grid-template-columns:repeat(5,1fr);gap:34px 14px;padding:8px}
  .tech-node{min-height:112px;padding:10px 5px;row-gap:8px;border-color:#6e9acf63;background:#14213bc9;position:relative;z-index:1}
  .tech-icon{width:42px;height:42px}.tech-icon>.icon{width:26px;height:26px}
  .tech-node.researched{border-color:#53e9b5;background:#153e465d}.tech-node.available{border-color:#74d9ff;box-shadow:0 0 10px #31d0ff20}
  .tech-name{font-size:11px}.tech-name small{font-size:7px;letter-spacing:.4px}
  .resource-row{min-height:111px}.resource-name strong{font-size:14px}.resource-name small{font-size:10px}
  .resource-name .resource-icon{width:45px;height:45px}.resource-row>.mono:nth-child(2){font-size:17px}
  .resource-row .autosell select{min-height:40px;font-size:11px}.resource-row>.mono:nth-child(3){font-size:11px;margin-left:0}
  .section-intro{font-size:12px}.production-heading p{font-size:12px}.info-banner{font-size:12px}
  .prestige-banner p{font-size:11px}.prestige-banner .eyebrow{font-size:8px}.prestige-banner h3{font-size:16px}
  .prestige-banner>.button{min-height:44px}.prestige-progress>span{font-size:10px}
  .room-card{min-height:111px;background:linear-gradient(120deg,#16364b,#1c2946);border-color:#669bcc35}
  .room-icon{width:40px;height:44px}.room-icon .icon{width:29px;height:29px}.room-copy h4{font-size:14px}.room-copy p{font-size:11px}
  .setting-row h3{font-size:16px}.setting-row p{font-size:13px}.about-note{font-size:11px}
  .guide-grid article p,.guide-intro p{font-size:13px}
  dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 24px);background:linear-gradient(#17294a,#131330)}
  .modal-header{padding:14px 16px}.modal-header h2{font-size:22px}.modal-header .icon-button{width:44px;height:44px}
  .modal-body{padding:15px}.recipe-option{gap:8px;padding:12px 0}.recipe-option>.resource-icon{width:40px;height:40px}
  .recipe-option-copy h4{font-size:12px}.recipe-option-copy p{font-size:11px}.recipe-option-copy small{font-size:9px}
  .project-description{font-size:14px}.reset-summary{font-size:12px}.project-costs>div>span:not(.resource-icon),.project-costs strong{font-size:13px}
  #toasts{top:155px;z-index:100}.toast{font-size:12px}
}
@media(max-width:360px){
  .currency div>span,.currency.dark div>span{font-size:22px}.currencies{gap:4px}
  .recipe-flow .resource-icon{width:34px;height:34px}.recipe-ingredient{font-size:9px;min-width:32px}
  .production-card{padding:11px 8px}.nav-item{font-size:9px}
}
@media(max-height:500px) and (pointer:coarse){
  .sheet,.planet-detail{height:65%;max-height:calc(100% - 64px)}
  .managers-sheet,.settings-sheet,.help-sheet,.stats-sheet{height:calc(100% - 64px)}
  .currency div>span,.currency.dark div>span{font-size:19px}.currencies{gap:0}
  .world-tools{top:105px;gap:0;flex-direction:row;right:8px}
}
