/* RRM P4.75 - Responsive UI authority layer */
:root{
  --rrm-ui-bg:color-mix(in srgb,var(--bd-panel) 90%,transparent);
  --rrm-ui-bg-strong:color-mix(in srgb,var(--bd-panel) 97%,transparent);
  --rrm-ui-surface:color-mix(in srgb,var(--bd-surface) 88%,transparent);
  --rrm-ui-line:rgba(226,232,240,.15);
  --rrm-ui-text:var(--bd-text);
  --rrm-ui-muted:var(--bd-text-muted);
  --rrm-ui-accent:var(--bd-accent);
  --rrm-ui-danger:var(--bd-danger);
  --rrm-ui-radius:10px;
  --rrm-ui-gap:8px;
  --rrm-topbar-height:44px;
  --rrm-bottombar-height:56px;
  --rrm-safe-top:env(safe-area-inset-top,0px);
  --rrm-safe-bottom:env(safe-area-inset-bottom,0px);
  --rrm-touch-target:44px;
  --rrm-z-world-overlay:10000;
  --rrm-z-hud:20000;
  --rrm-z-panel:60000;
  --rrm-z-drawer:70000;
  --rrm-z-modal-backdrop:85000;
  --rrm-z-modal:90000;
  --rrm-z-modal-secondary:92000;
  --rrm-z-tooltip:96000;
  --rrm-z-game-keyboard:109000;
  --rrm-z-critical-alert:100000;
  --rrm-z-screen:105000;
  --rrm-z-screen-modal:108000;
  --rrm-z-debug-overlay:110000;
}

body.rrmUiShellP475{
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body.rrmUiShellP475 #gameRoot{isolation:isolate;}
body.rrmUiShellP475 #game{touch-action:none;}
body.rrmUiShellP475 .pm-popup canvas,body.rrmUiShellP475 .rrmSheetP475 canvas{touch-action:pan-y;}

body.rrmUiShellP475 .hudTop{
  position:fixed!important;
  top:calc(var(--rrm-safe-top) + 8px)!important;
  left:10px!important;
  right:auto!important;
  width:auto!important;
  max-width:min(1040px, calc(100vw - 20px))!important;
  min-height:var(--rrm-topbar-height)!important;
  padding:6px!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:6px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  border-radius:var(--rrm-ui-radius)!important;
  border:1px solid var(--rrm-ui-line)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 94%,transparent), color-mix(in srgb,var(--bd-panel) 76%,transparent))!important;
  box-shadow:0 10px 28px rgba(0,0,0,.28)!important;
  backdrop-filter:blur(10px)!important;
  z-index:var(--rrm-z-hud)!important;
  scrollbar-width:none;
}
body.rrmUiShellP475 .hudTop::-webkit-scrollbar,
body.rrmUiShellP475 .hudBottom .buttons::-webkit-scrollbar{display:none;}
body.rrmUiShellP475 .hudBottom{
  position:fixed!important;
  left:10px!important;
  right:auto!important;
  bottom:calc(var(--rrm-safe-bottom) + 10px)!important;
  width:auto!important;
  max-width:calc(100vw - 20px)!important;
  min-height:var(--rrm-bottombar-height)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  padding:7px!important;
  border-radius:14px!important;
  border:1px solid var(--rrm-ui-line)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 92%,transparent), color-mix(in srgb,var(--bd-panel) 78%,transparent))!important;
  box-shadow:0 12px 34px rgba(0,0,0,.34)!important;
  backdrop-filter:blur(10px)!important;
  z-index:var(--rrm-z-hud)!important;
}
body.rrmUiShellP475 .hudBottom .buttons{
  width:auto!important;
  max-width:min(820px, calc(100vw - 92px))!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:6px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none;
}
body.rrmUiShellP475 button:not(#startScreen button),
body.rrmUiShellP475 .iconOnly:not(#startScreen .iconOnly),
body.rrmUiShellP475 .iconPill{
  border-radius:9px!important;
  border:1px solid var(--rrm-ui-line)!important;
  background:color-mix(in srgb,var(--bd-surface) 92%,transparent)!important;
  color:var(--rrm-ui-text)!important;
}
body.rrmUiShellP475 button:not(#startScreen button):hover,
body.rrmUiShellP475 .iconOnly:not(#startScreen .iconOnly):hover{background:rgba(51,65,85,.96)!important;}
body.rrmUiShellP475 button:not(#startScreen button).active,
body.rrmUiShellP475 .iconOnly:not(#startScreen .iconOnly).active{
  background:rgba(146,64,14,.96)!important;
  border-color:rgba(250,204,21,.72)!important;
}
body.rrmUiShellP475 .iconOnly{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 38px!important;
  font-size:16px!important;
  line-height:1!important;
}
body.rrmUiShellP475 .iconPill{
  height:38px!important;
  min-height:38px!important;
  padding:7px 10px!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:5px!important;
  white-space:nowrap!important;
  flex:0 0 auto!important;
  font-size:12px!important;
}
body.rrmUiShellP475 .widePill{
  flex:1 1 260px!important;
  min-width:220px!important;
  max-width:420px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.rrmUiShellP475 .hudTop .iconPill:has(#moneyCount){order:2;}
body.rrmUiShellP475 .hudTop .iconPill:has(#colonistCount){order:1;}
body.rrmUiShellP475 .hudTop .widePill{order:3;}
body.rrmUiShellP475 .hudTop #pauseBtn{order:4;}
body.rrmUiShellP475 .hudTop #speedBtn{order:5;}
body.rrmUiShellP475 .hudTop #zoomOut{order:6;}
body.rrmUiShellP475 .hudTop #zoomIn{order:7;}
body.rrmUiShellP475 .hudTop #infoBtn{order:8;}
body.rrmUiShellP475 .hudTop #colonyControlBtn{order:8.5;}
body.rrmUiShellP475 .hudTop #saveBtn{order:9;}
body.rrmUiShellP475 .hudTop #gameVersionLabel{order:10;}
body.rrmUiShellP475 #speedBtn{
  width:auto!important;
  min-width:66px!important;
  padding:0 10px!important;
  flex:0 0 auto!important;
}
body.rrmUiShellP475 .gameVersionLabel{
  height:32px!important;
  min-width:48px!important;
  padding:4px 10px!important;
  font-size:11px!important;
  border-radius:999px!important;
  position:static!important;
  right:auto!important;
  bottom:auto!important;
  z-index:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid var(--rrm-ui-line)!important;
  background:color-mix(in srgb,var(--bd-panel) 92%,transparent)!important;
  color:var(--rrm-ui-muted)!important;
  flex:0 0 auto!important;
  margin-left:auto!important;
}

body.rrmUiShellP475 .rrmSheetP475,
body.rrmUiShellP475 .buildMenu,
body.rrmUiShellP475 .panel,
body.rrmUiShellP475 .sidePanel,
body.rrmUiShellP475 .objectPopup{
  box-sizing:border-box!important;
  color:var(--rrm-ui-text)!important;
  background:var(--rrm-ui-bg-strong)!important;
  border:1px solid var(--rrm-ui-line)!important;
  border-radius:12px!important;
  box-shadow:0 18px 50px rgba(0,0,0,.42)!important;
  backdrop-filter:blur(10px)!important;
  z-index:var(--rrm-z-panel)!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
body.rrmUiShellP475 .buildMenu,
body.rrmUiShellP475 .panel:not(#workPanel){









  padding:10px!important;
}
body.rrmUiShellP475 #buildMenu{


}
body.rrmUiShellP475 #workPanel{








  padding:0!important;
}
body.rrmUiShellP475 #workPanel h3,
body.rrmUiShellP475 .buildMenu>h3,
body.rrmUiShellP475 .panel>h3,
body.rrmUiShellP475 .objectPopupHeader,
body.rrmUiShellP475 .sidePanelHeader{
  position:sticky!important;
  top:0!important;
  z-index:2!important;
  margin:0 0 8px 0!important;
  padding:10px 44px 9px 10px!important;
  min-height:40px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  background:color-mix(in srgb,var(--bd-panel) 98%,transparent)!important;
  border-bottom:1px solid color-mix(in srgb,var(--bd-border-soft) 42%,transparent)!important;
}
body.rrmUiShellP475 #workPanel .wpTableWrap{
  max-height:calc(100dvh - var(--rrm-topbar-height) - var(--rrm-bottombar-height) - 110px)!important;
  overflow:auto!important;
  padding:0 10px 10px!important;
}
body.rrmUiShellP475 #workPanel table{
  min-width:760px!important;
  width:100%!important;
}
body.rrmUiShellP475 .sidePanel{








  padding:0!important;
}
body.rrmUiShellP475 .sidePanel:not(.open){display:none!important;}
body.rrmUiShellP475 .sidePanel.open{display:flex!important;flex-direction:column!important;}
body.rrmUiShellP475 .sidePanel .panelTabs{
  flex:0 0 auto!important;
  display:flex!important;
  gap:6px!important;
  padding:8px 10px!important;
  margin:0!important;
  overflow-x:auto!important;
}
body.rrmUiShellP475 .sidePanel .panelTabs button{
  min-height:34px!important;
  min-width:54px!important;
  padding:6px 9px!important;
}
body.rrmUiShellP475 #panelContent,
body.rrmUiShellP475 #objectPopupBody{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:10px!important;
}
body.rrmUiShellP475 #panelContent{flex:1 1 auto!important;}
body.rrmUiShellP475 .objectPopup{







  padding:0!important;
}
body.rrmUiShellP475 .objectPopup[style*="display: none"]{display:none!important;}
body.rrmUiShellP475 .panelSection,
body.rrmUiShellP475 .objectInfoLine,
body.rrmUiShellP475 .statRow,
body.rrmUiShellP475 .recipeButton,
body.rrmUiShellP475 .researchCard,
body.rrmUiShellP475 .eventCard,
body.rrmUiShellP475 .visitorCard{
  border-radius:9px!important;
  background:color-mix(in srgb,var(--bd-surface) 56%,transparent)!important;
  border:1px solid color-mix(in srgb,var(--bd-border-soft) 38%,transparent)!important;
}
body.rrmUiShellP475 .statRow,
body.rrmUiShellP475 .objectInfoLine{
  min-width:0!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}

body.rrmUiShellP475 .mobileDrawer{
  visibility:hidden!important;
  pointer-events:none!important;
}
body.rrmUiShellP475 .mobileDrawer.open{
  position:fixed!important;
  display:block!important;
  visibility:visible!important;
  pointer-events:auto!important;
  left:10px!important;
  right:10px!important;
  bottom:calc(var(--rrm-bottombar-height, 72px) + var(--rrm-safe-bottom, 0px) + 14px)!important;
  width:auto!important;
  max-height:min(42dvh, 360px)!important;
  padding:10px!important;
  border-radius:16px!important;
  overflow:auto!important;
  z-index:var(--rrm-z-drawer)!important;
}
body.rrmUiShellP475 .mobileMenuBtn{
  position:static!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
body.rrmUiShellP475 .hudBottom .buttons > .iconOnly{
  display:none!important;
}
body.rrmUiShellP475 #markBtn,
body.rrmUiShellP475 #buildBtn,
body.rrmUiShellP475 #researchBtn,
body.rrmUiShellP475 #visitorsBtn,
body.rrmUiShellP475 #workBtn,
body.rrmUiShellP475 #externalMapBtn,
body.rrmUiShellP475 #mobileMenuBtn{
  display:inline-flex!important;
}
body.rrmUiShellP475 #markBtn{order:1;}
body.rrmUiShellP475 #buildBtn{order:2;}
body.rrmUiShellP475 #researchBtn{order:3;}
body.rrmUiShellP475 #visitorsBtn{order:4;}
body.rrmUiShellP475 #workBtn{order:5;}
body.rrmUiShellP475 #externalMapBtn{order:6;}
body.rrmUiShellP475 #mobileMenuBtn{order:7;}
body.rrmUiShellP475 #debugDownloadBtn,
body.rrmUiShellP475 #overlayBtn,
body.rrmUiShellP475 #fullscreenBtn,
body.rrmUiShellP475 #debugBtn,
body.rrmUiShellP475 #qaBtn,
body.rrmUiShellP475 #perfOverlayBtn,
body.rrmUiShellP475 #pawnStateDebugBtnP42712,
body.rrmUiShellP475 #jobAuditorBtn,
body.rrmUiShellP475 #economyBalanceBtnP414,
body.rrmUiShellP475 #gameBalanceBtnP415{
  display:none!important;
}
body.rrmUiShellP475 .hudTop #overlayBtn,
body.rrmUiShellP475 .hudTop #fullscreenBtn{
  display:none!important;
}
body.rrmUiShellP475 .areaModePanel{
  position:fixed!important;
  left:10px!important;
  bottom:calc(var(--rrm-bottombar-height) + var(--rrm-safe-bottom) + 22px)!important;
  display:none!important;
  grid-template-columns:repeat(3, minmax(86px, 1fr))!important;
  gap:6px!important;
  padding:7px!important;
  border-radius:14px!important;
  border:1px solid var(--rrm-ui-line)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 96%,transparent), color-mix(in srgb,var(--bd-panel) 84%,transparent))!important;
  box-shadow:0 14px 36px rgba(0,0,0,.36)!important;
  backdrop-filter:blur(10px)!important;
  z-index:calc(var(--rrm-z-hud) + 4)!important;
}
body.rrmUiShellP475 .areaModePanel.open{
  display:grid!important;
}
body.rrmUiShellP475 .areaModePanel button{
  min-height:38px!important;
  padding:6px 10px!important;
  font-size:12px!important;
  font-weight:800!important;
}

@media (max-width:860px), (pointer:coarse){
  :root{
    --rrm-topbar-height:42px;
    --rrm-bottombar-height:104px;
  }
  body.rrmUiShellP475 .hudTop{
    top:calc(var(--rrm-safe-top) + 6px)!important;
    left:6px!important;
    right:6px!important;
    width:auto!important;
    max-width:calc(100vw - 12px)!important;
    min-height:var(--rrm-topbar-height)!important;
    padding:5px!important;
    gap:4px!important;
    border-radius:0 0 12px 12px!important;
  }
  body.rrmUiShellP475 .hudTop .iconOnly,
  body.rrmUiShellP475 #pauseBtn,
  body.rrmUiShellP475 #zoomIn,
  body.rrmUiShellP475 #zoomOut,
  body.rrmUiShellP475 #infoBtn,
  body.rrmUiShellP475 #saveBtn,
  body.rrmUiShellP475 #debugDownloadBtn,
  body.rrmUiShellP475 #overlayBtn,
  body.rrmUiShellP475 #fullscreenBtn{
    width:30px!important;
    height:34px!important;
    min-width:30px!important;
    min-height:34px!important;
    flex-basis:30px!important;
    font-size:13px!important;
  }
  body.rrmUiShellP475 .hudTop .iconPill{
    height:34px!important;
    min-height:34px!important;
    padding:5px 6px!important;
    font-size:11px!important;
  }
  body.rrmUiShellP475 .widePill{
    flex:1 1 160px!important;
    min-width:160px!important;
    max-width:220px!important;
  }
  body.rrmUiShellP475 #speedBtn{
    min-width:56px!important;
    min-height:34px!important;
    height:34px!important;
    padding:0 8px!important;
    font-size:11px!important;
  }
  body.rrmUiShellP475 #debugDownloadBtn,
  body.rrmUiShellP475 #overlayBtn,
  body.rrmUiShellP475 #fullscreenBtn{
    display:none!important;
  }
  body.rrmUiShellP475.rrmDebugUiEnabledP475 #debugDownloadBtn,
  body.rrmUiShellP475.rrmDebugUiEnabledP475 #debugBtn,
  body.rrmUiShellP475.rrmDebugUiEnabledP475 #qaBtn{
    display:none!important;
  }
  body.rrmUiShellP475 .hudBottom{
    left:6px!important;
    right:6px!important;
    bottom:calc(var(--rrm-safe-bottom) + 6px)!important;
    width:auto!important;
    max-width:none!important;
    min-height:var(--rrm-bottombar-height)!important;
    padding:6px!important;
    border-radius:14px!important;
  }
  body.rrmUiShellP475 .hudBottom .buttons{
    flex:1 1 auto!important;
    max-width:none!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(4, minmax(0, 1fr))!important;
    gap:5px!important;
    overflow:visible!important;
  }
  body.rrmUiShellP475 .hudBottom .buttons .iconOnly{
    width:100%!important;
    height:44px!important;
    min-width:0!important;
    min-height:44px!important;
    max-width:none!important;
    flex:1 1 auto!important;
    font-size:16px!important;
  }
  body.rrmUiShellP475 #markBtn,
  body.rrmUiShellP475 #buildBtn,
  body.rrmUiShellP475 #researchBtn,
  body.rrmUiShellP475 #visitorsBtn,
  body.rrmUiShellP475 #workBtn,
  body.rrmUiShellP475 #externalMapBtn,
  body.rrmUiShellP475 #mobileMenuBtn{
    display:inline-flex!important;
  }
  body.rrmUiShellP475 #markBtn{order:1;}
  body.rrmUiShellP475 #buildBtn{order:2;}
  body.rrmUiShellP475 #researchBtn{order:3;}
  body.rrmUiShellP475 #visitorsBtn{order:4;}
  body.rrmUiShellP475 #workBtn{order:5;}
  body.rrmUiShellP475 #externalMapBtn{order:6;}
  body.rrmUiShellP475 #mobileMenuBtn{order:7;}
  body.rrmUiShellP475 #stockBtn,
  body.rrmUiShellP475 #farmBtn,
  body.rrmUiShellP475 #centerBtn,
  body.rrmUiShellP475 #balanceBtn,
  body.rrmUiShellP475 #eventsBtn,
  body.rrmUiShellP475 #storyBtn,
  body.rrmUiShellP475 #debugBtn,
  body.rrmUiShellP475 #qaBtn{
    display:none!important;
  }
  body.rrmUiShellP475 .hudTop #gameVersionLabel{
    height:24px!important;
    min-width:44px!important;
    padding:2px 8px!important;
    font-size:10px!important;
  }
  body.rrmUiShellP475 .mobileMenuBtn{
    position:static!important;
    display:inline-flex!important;
    visibility:visible!important;
    pointer-events:auto!important;
    width:100%!important;
    height:44px!important;
    min-width:0!important;
    min-height:44px!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:9px!important;
    z-index:auto!important;
    font-size:16px!important;
  }
  body.rrmUiShellP475 .mobileDrawer{
    position:fixed!important;
    display:none!important;
    visibility:visible!important;
    pointer-events:auto!important;
    left:6px!important;
    right:6px!important;
    bottom:calc(var(--rrm-bottombar-height) + var(--rrm-safe-bottom) + 14px)!important;
    width:auto!important;
    max-height:min(46dvh, 360px)!important;
    padding:10px!important;
    border-radius:16px!important;
    background:var(--rrm-ui-bg-strong)!important;
    border:1px solid var(--rrm-ui-line)!important;
    box-shadow:0 18px 50px rgba(0,0,0,.48)!important;
    z-index:var(--rrm-z-drawer)!important;
    overflow:auto!important;
  }
  body.rrmUiShellP475 .mobileDrawer.open{display:block!important;}
  body.rrmUiShellP475 .mobileDrawerGrid{
    display:grid!important;
    grid-template-columns:repeat(auto-fit, minmax(148px, 1fr))!important;
    gap:7px!important;
  }
  body.rrmUiShellP475 .mobileDrawerGrid button{
    min-width:0!important;
    min-height:56px!important;
    padding:6px 9px!important;
    white-space:normal!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    font-size:16px!important;
    text-align:right!important;
  }
  body.rrmUiShellP475 .mobileDrawerGrid button>small{flex:1 1 auto!important;min-width:0!important;font-size:10px!important;line-height:1.05!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:right!important;}
  body.rrmUiShellP475 .areaModePanel{
    left:6px!important;
    right:6px!important;
    bottom:calc(var(--rrm-bottombar-height) + var(--rrm-safe-bottom) + 14px)!important;
    grid-template-columns:repeat(3, minmax(0,1fr))!important;
  }
  body.rrmUiShellP475 .areaModePanel button{
    min-width:0!important;
    padding:6px 5px!important;
    font-size:11px!important;
  }
  body.rrmUiShellP475 .buildMenu,
  body.rrmUiShellP475 .panel,
  body.rrmUiShellP475 #workPanel,
  body.rrmUiShellP475 .sidePanel,
  body.rrmUiShellP475 .sidePanel.open,
  body.rrmUiShellP475 .objectPopup{








    border-radius:16px!important;

    padding:0!important;
  }
  body.rrmUiShellP475 .buildMenu,
  body.rrmUiShellP475 .panel:not(#workPanel){
    padding:0 10px 10px!important;
  }
  body.rrmUiShellP475 .sidePanel:not(.open){display:none!important;}
  body.rrmUiShellP475 #panelContent,
  body.rrmUiShellP475 #objectPopupBody,
  body.rrmUiShellP475 #workPanel .wpTableWrap{
    max-height:calc(100dvh - var(--rrm-topbar-height) - var(--rrm-bottombar-height) - var(--rrm-safe-top) - var(--rrm-safe-bottom) - 96px)!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.rrmUiShellP475 .buildOptions{
    display:grid!important;
    grid-template-columns:repeat(4, minmax(0, 1fr))!important;
    gap:7px!important;
  }
  body.rrmUiShellP475 .buildOptions .iconOnly,
  body.rrmUiShellP475 .buildOptions > button{
    width:100%!important;
    min-width:0!important;
    height:42px!important;
    min-height:42px!important;
  }
  body.rrmUiShellP475 .panelTabs button{
    min-width:68px!important;
    min-height:38px!important;
  }
  body.rrmUiShellP475 input,
  body.rrmUiShellP475 select{
    min-height:40px!important;
    font-size:16px!important;
  }
  body.rrmUiShellP475 .eventAlert{



    z-index:var(--rrm-z-modal)!important;
  }
}

@media (max-width:520px){
  body.rrmUiShellP475 .hudTop{
    padding:4px!important;
    gap:3px!important;
  }
  body.rrmUiShellP475 .widePill span:nth-child(n/**/+7){
    display:none!important;
  }
  body.rrmUiShellP475 .widePill{
    min-width:118px!important;
    max-width:140px!important;
  }
  body.rrmUiShellP475 .hudTop .iconPill{
    padding:5px!important;
  }
  body.rrmUiShellP475 .hudTop .iconOnly,
  body.rrmUiShellP475 #pauseBtn,
  body.rrmUiShellP475 #zoomIn,
  body.rrmUiShellP475 #zoomOut,
  body.rrmUiShellP475 #infoBtn,
  body.rrmUiShellP475 #saveBtn{
    width:28px!important;
    min-width:28px!important;
    flex-basis:28px!important;
  }
  body.rrmUiShellP475 #speedBtn{
    min-width:50px!important;
    padding:0 6px!important;
  }
  body.rrmUiShellP475 .hudTop #gameVersionLabel{
    min-width:40px!important;
    padding:2px 6px!important;
    font-size:9px!important;
  }
}

@media (min-width:861px) and (pointer:fine){
  body.rrmUiShellP475 .mobileDrawer{display:none!important;}
}


/* P10.24.67 — UI-C canonical modal scroll/lifecycle presentation.
   Geometry remains inline-owned by ModalLayout; this existing stylesheet owns
   the reusable shell semantics and z-layer tokens. */
.rrmModalShellP102467{
  box-sizing:border-box;
  overscroll-behavior:contain;
  z-index:var(--rrm-z-modal);
}
.rrmModalShellP102467[data-modal-debug-only="true"]{z-index:var(--rrm-z-debug-overlay);}
#eventAlert.rrmModalShellP102467{z-index:var(--rrm-z-critical-alert);}
:is(#rrmEquipmentPopup,#rrmProfessionPopup,#rrmMoodPopup).rrmModalShellP102467{z-index:var(--rrm-z-modal-secondary);}
.rrmModalHeaderP102467{flex:0 0 auto;position:relative;}
.rrmModalBodyP102467{
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
}
.rrmModalBodyP102467.wpTableWrap,
#researchPanel .rrmModalBodyP102467,
.rrmModalBodyP102467.regionMapViewport,
.rrmModalBodyP102467.rrmTechTreeScrollerP10190{
  overflow:auto;
  touch-action:pan-x pan-y;
}
body.rrmModalSessionOpenP102467{overscroll-behavior:none;}
@media (max-width:900px),(pointer:coarse){
  body.rrmDenseModalOpenMobileP102467 .hudTop,
  body.rrmDenseModalOpenMobileP102467 .hudBottom{
    display:none;
    visibility:hidden;
    pointer-events:none;
  }
  body:not(.rrmDenseModalOpenMobileP102467) .rrmModalCompactP102467,
  body:not(.rrmDenseModalOpenMobileP102467) .rrmModalMediumP102467{
    border-radius:var(--bd-radius-panel,12px);
  }
}
.rrmPopupManagedP424 .panelSection,.rrmPopupManagedP424 .objectPopupSection{box-sizing:border-box;}
.rrmManagedGridP424{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:8px;
  align-items:stretch;
  width:100%;
  box-sizing:border-box;
}
.rrmPopupMobileP424 .rrmManagedGridP424{grid-template-columns:repeat(auto-fit,minmax(142px,1fr));}
.rrmPopupManagedP424 .statRow,.rrmPopupManagedP424 .objectInfoLine{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  overflow:visible;
  white-space:normal;
  box-sizing:border-box;
}
.rrmPopupManagedP424 .statRow span,.rrmPopupManagedP424 .objectInfoLine span{
  min-width:0;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  overflow-wrap:anywhere;
}


/* P10.24.93 — canonical layering invariant: gameplay popups always render above HUD bars. */
body.rrmUiShellP475 .hudTop,
body.rrmUiShellP475 .hudBottom{
  z-index:20000!important;
}
body.rrmUiShellP475 :is(
  #workPanel,
  #buildMenu,
  .buildMenu,
  .panel,
  .objectPopup,
  .sidePanel,
  .rrmModalShellP102467
):not(#debugPanel):not([data-modal-debug-only="true"]){
  z-index:90000!important;
}
body.rrmUiShellP475 #eventAlert{z-index:100000!important;}


/* P10.24.94 — modal backdrop is a real layer above HUD and below popups.
   This also prevents the bottom/top HUD bars from receiving pointer input
   while a gameplay modal is open. */
#rrmModalBackdropP102494{
  position:fixed!important;
  inset:0!important;
  z-index:85000!important;
  background:rgba(0,0,0,.14)!important;
  pointer-events:auto!important;
  touch-action:none!important;
}
body.rrmGameplayModalOpenP102494 .hudTop,
body.rrmGameplayModalOpenP102494 .hudBottom{
  z-index:20000!important;
  pointer-events:none!important;
}
body.rrmGameplayModalOpenP102494 :is(#objectPopup,#workPanel,#buildMenu,.buildMenu,.panel,.objectPopup,.rrmModalShellP102467):not(#debugPanel):not([data-modal-debug-only="true"]){
  z-index:90000!important;
}

/* P10.25.20 — keep the settings shortcut reachable without overflowing the
   compact landscape HUD. The mobile drawer keeps a full-size touch target. */
@media(max-width:800px){
  body.rrmUiShellP475 .hudTop #settingsHudBtn{display:none!important;}
  body.rrmUiShellP475 .areaModePanel button{min-height:44px!important;}
}

/* P10.25.20 — restore 44 px touch targets on compact landscape HUD controls. */
@media(max-width:860px),(pointer:coarse){
  body.rrmUiShellP475 .hudTop #pauseBtn,
  body.rrmUiShellP475 .hudTop #zoomOut,
  body.rrmUiShellP475 .hudTop #zoomIn,
  body.rrmUiShellP475 .hudTop #infoBtn,
  body.rrmUiShellP475 .hudTop #saveBtn,
  body.rrmUiShellP475 .hudTop #settingsHudBtn{
    width:44px!important;min-width:44px!important;max-width:44px!important;
    flex:0 0 44px!important;height:44px!important;min-height:44px!important;
  }
  body.rrmUiShellP475 .hudTop #speedBtn{
    min-width:44px!important;min-height:44px!important;height:44px!important;
  }
  body.rrmUiShellP475 .hudBottom .buttons .iconOnly{
    width:49px!important;min-width:49px!important;max-width:49px!important;
    flex:0 0 49px!important;height:49px!important;min-height:49px!important;
  }
  body.rrmUiShellP475 .areaModePanel button{min-width:49px!important;min-height:49px!important;}
}

/* P10.25.20 — component-local popup rules need the registered panel ID in the
   selector so they cannot shrink primary actions below the mobile target. */
@media(max-width:900px),(pointer:coarse){
  html[data-bd-theme] body.rrmUiShellP475 :is(#workPanel,#buildMenu,#researchPanel,#eventsPanel,#storyPanel,#visitorsPanel,#balancePanel,#farmPanel,#savePanel,#saveLoadPanel,#objectPopup,#sidePanel).rrmPopupMobileP424 button:not(.wpPrioBox),
  html[data-bd-theme] body.rrmUiShellP475 :is(#workPanel,#buildMenu,#researchPanel,#eventsPanel,#storyPanel,#visitorsPanel,#balancePanel,#farmPanel,#savePanel,#saveLoadPanel,#objectPopup,#sidePanel).rrmPopupMobileP424 .wpPrioBox{
    min-width:44px!important;
    min-height:44px!important;
    touch-action:manipulation!important;
  }
}

/* P10.25.22 — keep Save immediately reachable on the narrowest landscape HUDs. */
@media(max-width:667px) and (max-height:600px) and (min-aspect-ratio:6/5){
  body.rrmUiShellP475 .hudTop #saveBtn{order:3!important;}
  body.rrmUiShellP475 .hudTop #infoBtn{order:9!important;}
  body.rrmUiShellP475 .mobileDrawerGrid button{min-height:56px!important;}
}

/* P10.25.22 — prevent compact component rules from shrinking active touch targets. */
@media(max-width:900px),(pointer:coarse){
  html[data-bd-theme] body.rrmUiShellP475 :is(#workPanel,#buildMenu,#researchPanel,#eventsPanel,#storyPanel,#visitorsPanel,#balancePanel,#farmPanel,#savePanel,#objectPopup,#sidePanel).rrmPopupMobileP424 button:not([data-bd-quantity-delta]),
  html[data-bd-theme] body.rrmUiShellP475 :is(#workPanel,#buildMenu,#researchPanel,#eventsPanel,#storyPanel,#visitorsPanel,#balancePanel,#farmPanel,#savePanel,#objectPopup,#sidePanel).rrmPopupMobileP424 .wpPrioBox{
    height:auto!important;
    min-height:44px!important;
  }
}

