/* RRM P4.85 modern skin — P10.24.65 UI-A: compatibility aliases only.
   ThemeTokens owns palette; the modern skin owns component styling, not color identity. */
:root{
  --rrm-modern-bg:var(--bd-bg);
  --rrm-modern-panel:var(--bd-panel);
  --rrm-modern-panel-2:var(--bd-panel-alt);
  --rrm-modern-card:var(--bd-panel-alt);
  --rrm-modern-card-2:var(--bd-surface);
  --rrm-modern-gold:var(--bd-accent);
  --rrm-modern-gold-2:var(--bd-selection);
  --rrm-modern-line:var(--bd-border);
  --rrm-modern-line-soft:var(--bd-border-soft);
  --rrm-modern-text:var(--bd-text);
  --rrm-modern-muted:var(--bd-text-muted);
  --rrm-modern-blue:var(--bd-info);
  --rrm-modern-blue-2:var(--bd-accent-hover);
  --rrm-modern-green:var(--bd-success);
  --rrm-modern-warn:var(--bd-warning);
  --rrm-modern-danger:var(--bd-danger);
  --rrm-modern-shadow:var(--bd-shadow-popup);
}

/* P5.79 manual save history */
.settingsStaticValue{
  display:block;
  min-height:34px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:6px;
  color:#d7dde5;
  background:#24282d;
}

.rrmSaveHistoryOverlay[hidden]{display:none!important;}
.rrmSaveHistoryOverlay{
  position:fixed;
  inset:0;
  z-index:var(--rrm-z-screen-modal);
  display:grid;
  place-items:center;
  padding:16px;
  background:rgba(8,10,12,.78);
}
.rrmSaveHistoryDialog{
  width:min(620px,100%);
  max-height:min(720px,calc(100vh - 32px));
  overflow:auto;
  border:1px solid #4b5159;
  border-radius:8px;
  background:#181b1f;
  color:var(--bd-text);
  box-shadow:0 18px 54px rgba(0,0,0,.48);
}
.rrmSaveHistoryHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 18px 14px;
  border-bottom:1px solid #363b42;
}
.rrmSaveHistoryHeader h2{margin:0;font-size:20px;letter-spacing:0;}
.rrmSaveHistoryHeader p{margin:5px 0 0;color:var(--bd-text-muted);font-size:12px;}
.rrmSaveHistoryHeader .iconOnly{flex:0 0 36px;width:36px;height:36px;min-width:36px;min-height:36px;border-radius:6px;}
.rrmSaveHistoryList{display:flex;flex-direction:column;min-height:110px;padding:4px 18px 14px;}
.rrmSaveHistoryRow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  min-height:76px;
  padding:12px 0;
  border-bottom:1px solid #30353b;
}
.rrmSaveHistoryCopy{display:flex;min-width:0;flex-direction:column;gap:5px;}
.rrmSaveHistoryName{font-size:14px;color:#fff;overflow-wrap:anywhere;}
.rrmSaveHistoryMeta{font-size:11px;color:var(--bd-text-muted);overflow-wrap:anywhere;}
.rrmSaveHistoryActions{display:flex;gap:7px;}
.rrmSaveHistoryActions button{min-height:36px;border-radius:6px;padding:7px 11px;}
.rrmSaveLoadButton{background:#28633e!important;border-color:#4d9b68!important;color:#fff!important;}
.rrmSaveDeleteButton{background:#542b2d!important;border-color:#9a5155!important;color:#fff!important;}
.rrmSaveHistoryEmpty{margin:auto;padding:32px 12px;text-align:center;color:var(--bd-text-muted);}

@media (max-width:900px), (pointer:coarse){
  .rrmSaveHistoryOverlay{align-items:stretch;padding:0!important;}
  .rrmSaveHistoryDialog{width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;}
  .rrmSaveHistoryHeader{padding:15px 14px 12px;}
  .rrmSaveHistoryList{padding:2px 14px 12px;}
  .rrmSaveHistoryRow{grid-template-columns:1fr;gap:9px;padding:13px 0;}
  .rrmSaveHistoryActions{display:grid;grid-template-columns:1fr 1fr;}
  .rrmSaveHistoryActions button{width:100%;}
}

/* P5.67 - Tactical combat HUD */
body.rrmModernUiP485 .rrmColonistAvatarCombatReady{
  position:relative;
}
body.rrmModernUiP485 .rrmColonistCombatToggleP67{
  position:absolute!important;
  top:6px;
  left:6px;
  z-index:3;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
  border-radius:9px!important;
  border:1px solid rgba(246,215,122,.58)!important;
  background:rgba(12,24,38,.92)!important;
  color:#f8e7a0!important;
  box-shadow:0 8px 18px rgba(0,0,0,.28), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 50%,transparent)!important;
  font-size:15px!important;
  line-height:1!important;
}
body.rrmModernUiP485 .rrmColonistCombatToggleP67.active{
  border-color:var(--bd-info)!important;
  background:rgba(30,64,120,.94)!important;
  color:#eff6ff!important;
}
.rrmCombatSideHud{
  position:fixed;
  right:12px;
  left:auto;
  top:50%;
  transform:translateY(-50%) translateX(18px);
  width:52px;
  z-index:var(--rrm-z-hud);
  display:none;
  gap:6px;
  padding:6px;
  border:1px solid rgba(246,215,122,.30);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(9,20,34,.94),rgba(7,15,25,.90));
  box-shadow:0 18px 48px rgba(0,0,0,.40), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
  backdrop-filter:blur(8px);
  pointer-events:auto;
}
.rrmCombatSideHud.open{
  display:grid;
  transform:translateY(-50%) translateX(0);
}
.rrmCombatHudHead{
  display:grid;
  align-items:center;
  justify-content:center;
  color:var(--bd-text);
  font:900 11px/1.1 Inter,Arial,sans-serif;
  text-transform:uppercase;
}
.rrmCombatHudHead b{
  display:grid;
  place-items:center;
  min-width:28px;
  height:24px;
  border-radius:999px;
  color:#06111f;
  background:var(--bd-selection);
}
.rrmCombatHudBtn{
  display:grid!important;
  place-items:center;
  align-items:center;
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px;
  padding:0!important;
  border-radius:9px!important;
  border:1px solid rgba(148,163,184,.28)!important;
  background:rgba(15,32,50,.86)!important;
  color:var(--bd-text)!important;
  text-align:center;
}
.rrmCombatHudBtn:hover,
.rrmCombatHudBtn.active{
  border-color:rgba(147,197,253,.76)!important;
  background:rgba(30,64,120,.88)!important;
}
.rrmCombatHudBtn.danger:hover{
  border-color:rgba(248,113,113,.82)!important;
  background:rgba(110,24,24,.88)!important;
}
.rrmCombatHudIcon{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
  font-size:15px;
}
.rrmCombatHudBtn span:not(.rrmCombatHudIcon){
  min-width:0;
  font:950 11px/1 Inter,Arial,sans-serif;
  letter-spacing:0;
}
.rrmCombatHudBtn small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--bd-text-muted);
  font:800 9px/1.15 Inter,Arial,sans-serif;
}
@media(max-width:760px){
  .rrmCombatSideHud{
    right:max(8px,env(safe-area-inset-right,0px));
    left:auto;
    top:calc(var(--rrm-topbar-height, var(--topbar-height, 44px)) + env(safe-area-inset-top,0px) + 58px);
    bottom:auto;
    width:50px;
    transform:translateY(0) translateX(16px);
  }
  .rrmCombatSideHud.open{
    transform:translateY(0) translateX(0);
  }
}

/* P4.118: close buttons are sprite-only; hide original glyph/text. */
body.rrmModernUiP485 #sideCloseBtn.iconOnly,
body.rrmModernUiP485 #objectPopupClose.iconOnly,
body.rrmModernUiP485 #wpClose.iconOnly,
body.rrmModernUiP485 .rrmPanelClose{
  font-size:0!important;
  line-height:0!important;
  color:transparent!important;
  text-shadow:none!important;
  overflow:hidden!important;
}

/* P4.122: a visão geral da colônia usa layout próprio em mobile.
   Evita herdar ancoragem inferior do objectPopup genérico. */
@media (pointer:coarse), (max-width:900px){
  body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup{












  }

  body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup #objectPopupBody{
    flex:1 1 auto!important;
    min-height:0!important;
    min-width:0!important;
    max-height:none!important;
    overflow:auto!important;
    box-sizing:border-box!important;
  }
}
body.rrmModernUiP485 :is(#sideCloseBtn,#objectPopupClose,#wpClose,.rrmPanelClose) .uiSpriteIcon{
  font-size:0!important;
  color:transparent!important;
}

html[data-rrm-ui="booting"] #gameRoot,
body.rrm-save-reconciling #gameRoot{
  visibility:hidden!important;
  pointer-events:none!important;
}

body.rrmModernUiP485{
  color:var(--rrm-modern-text);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.rrmModernUiP485 .hudTop .rrmHudPngIcon{
  width:31px!important;
  height:31px!important;
  min-width:31px!important;
  display:inline-flex!important;
  background-size:contain!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  color:transparent!important;
  font-size:0!important;
  line-height:0!important;
}

body.rrmModernUiP485 .pastureSelectorP211,
body.rrmModernUiP485 .pastureSelectorP25{
  display:none!important;
}

body.rrmModernUiP485 .hudTop,
body.rrmModernUiP485 .hudBottom,
body.rrmModernUiP485 .buildMenu,
body.rrmModernUiP485 .panel,
body.rrmModernUiP485 .sidePanel,
body.rrmModernUiP485 .objectPopup,
body.rrmModernUiP485 .mobileDrawer,
body.rrmModernUiP485 .areaModePanel,
body.rrmModernUiP485 .eventAlert{
  color:var(--rrm-modern-text)!important;
  background:
    radial-gradient(circle at 18% 0, rgba(54,92,130,.25), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 98%,transparent), color-mix(in srgb,var(--bd-bg) 96%,transparent))!important;
  border:2px solid var(--rrm-modern-line)!important;
  box-shadow:var(--rrm-modern-shadow)!important;
  backdrop-filter:blur(8px)!important;
}

/* P4.98.2 - canonical popup shell.
   Uses ID-aware specificity to win over historical popup rules. */
body.rrmModernUiP485 .rrmModernPanel{
  color:var(--rrm-modern-text)!important;
  background:
    radial-gradient(circle at 18% 0, rgba(54,92,130,.25), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 98%,transparent), color-mix(in srgb,var(--bd-bg) 96%,transparent))!important;
  border:2px solid var(--rrm-modern-line)!important;
  border-radius:26px!important;
  box-shadow:var(--rrm-modern-shadow)!important;
  backdrop-filter:blur(8px)!important;
}

body.rrmModernUiP485 :is(#sidePanel,#objectPopup,#workPanel).rrmModernPanel{
  border-radius:24px!important;
}

body.rrmModernUiP485 #eventAlert.rrmModernPanel{
  padding:16px!important;
  border-radius:22px!important;
}

body.rrmModernUiP485 :is(
  .buildMenu,
  .panel
) > h3,
body.rrmModernUiP485 :is(
  .objectPopupHeader,
  .sidePanelHeader,
  .wpHeader,
  .panelHeader,
  .p42712Head
),
body.rrmModernUiP485 #eventAlert.rrmModernPanel > .eventAlertTitle{
  position:sticky!important;
  top:0!important;
  z-index:5!important;
  min-height:56px!important;
  margin:-16px -16px 14px -16px!important;
  padding:15px 66px 12px 18px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  border-bottom:1px solid var(--rrm-modern-line-soft)!important;
  color:var(--rrm-modern-gold-2)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 99%,transparent), color-mix(in srgb,var(--bd-bg-secondary) 98%,transparent))!important;
  font-size:26px!important;
  font-weight:950!important;
  line-height:1.1!important;
  text-align:center!important;
  text-shadow:0 2px 2px rgba(0,0,0,.75)!important;
}

body.rrmModernUiP485 :is(
  #sidePanel .sidePanelHeader,
  #objectPopup .objectPopupHeader,
  #workPanel .wpHeader
){
}

body.rrmModernUiP485 #workPanel .wpHeader > h3{
  position:static!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  color:var(--rrm-modern-gold-2)!important;
  box-shadow:none!important;
  font-size:26px!important;
}

body.rrmModernUiP485 #pawnStateDebugPanelP42712.rrmModernPanel > .p42712Head{
  position:sticky!important;
  top:0!important;
  z-index:5!important;
  min-height:56px!important;
  padding:12px 18px!important;
  border-bottom:1px solid var(--rrm-modern-line-soft)!important;
  color:var(--rrm-modern-gold-2)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 99%,transparent), color-mix(in srgb,var(--bd-bg-secondary) 98%,transparent))!important;
}

body.rrmModernUiP485 #pawnStateDebugPanelP42712.rrmModernPanel :is(.p42712Metric,.p42712Row){
  border:1px solid color-mix(in srgb,var(--bd-border) 35%,transparent)!important;
  border-radius:12px!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel-alt) 92%,transparent), color-mix(in srgb,var(--bd-panel) 90%,transparent))!important;
}

body.rrmModernUiP485 #pawnStateDebugPanelP42712.rrmModernPanel button{
  border:1px solid var(--rrm-modern-line)!important;
  border-radius:12px!important;
  color:var(--rrm-modern-text)!important;
  background:linear-gradient(180deg, var(--bd-surface), var(--bd-bg-secondary))!important;
}

body.rrmModernUiP485 :is(
  .rrmPanelClose,
  #wpClose,
  #sideCloseBtn,
  #objectPopupClose,
  .panelHeader > button,
  .p42712Head button[data-act="close"]
){
  position:absolute!important;
  top:9px!important;
  right:10px!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:12px!important;
}

body.rrmModernUiP485 #eventAlert.rrmModernPanel > .eventAlertTitle{
  margin:-16px -16px 12px -16px!important;
  padding-right:18px!important;
}

body.rrmModernUiP485 #eventAlert.rrmModernPanel .eventAlertDesc{
  color:var(--rrm-modern-text)!important;
  font-size:14px!important;
  line-height:1.45!important;
}

body.rrmModernUiP485 #eventAlert.rrmModernPanel .eventAlertActions{
  padding-top:10px!important;
  border-top:1px solid var(--rrm-modern-line-soft)!important;
}

body.rrmModernUiP485 .hudTop{
  min-height:58px!important;
  padding:7px!important;
  gap:7px!important;
  border-radius:18px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}

body.rrmModernUiP485 .hudTop .iconPill{
  height:48px!important;
  min-height:48px!important;
  padding:8px 12px!important;
  gap:8px!important;
  border-radius:14px!important;
  border:1px solid var(--rrm-modern-line-soft)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel-alt) 96%,transparent), color-mix(in srgb,var(--bd-panel) 96%,transparent))!important;
  color:var(--rrm-modern-text)!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 34%,transparent), 0 6px 14px rgba(0,0,0,.25)!important;
  font-size:14px!important;
  font-weight:800!important;
}

body.rrmModernUiP485 .hudTop .iconPill .ico{
  min-width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:linear-gradient(180deg, var(--rrm-modern-gold-2), #b98323);
  color:#2a1904;
  font-size:12px;
  font-weight:900;
  text-shadow:none;
}

body.rrmModernUiP485 .hudTop .widePill{
  flex:0 0 auto!important;
  min-width:340px!important;
  max-width:none!important;
}

body.rrmModernUiP485 .gameVersionLabel{
  height:34px!important;
  min-width:62px!important;
  padding:5px 12px!important;
  border-color:var(--rrm-modern-line-soft)!important;
  background:rgba(7,13,22,.86)!important;
  color:var(--rrm-modern-gold-2)!important;
  font-weight:900!important;
  letter-spacing:0!important;
}

body.rrmModernUiP485 button:not(#startScreen button),
body.rrmModernUiP485 .iconOnly:not(#startScreen .iconOnly){
  border-radius:12px!important;
  border:1px solid var(--rrm-modern-line)!important;
  color:var(--rrm-modern-text)!important;
  background:
    radial-gradient(circle at 50% 12%, color-mix(in srgb,var(--bd-border-soft) 42%,transparent), transparent 34%),
    linear-gradient(180deg, var(--bd-surface), var(--bd-bg-secondary))!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 42%,transparent), 0 4px 12px rgba(0,0,0,.32)!important;
  font-family:inherit!important;
  font-weight:850!important;
  letter-spacing:0!important;
  text-shadow:0 1px 1px rgba(0,0,0,.60)!important;
  transition:transform .08s ease, filter .12s ease, border-color .12s ease;
}

body.rrmModernUiP485 button:not(#startScreen button):hover,
body.rrmModernUiP485 .iconOnly:not(#startScreen .iconOnly):hover{
  filter:brightness(1.12)!important;
  border-color:var(--rrm-modern-gold-2)!important;
}

body.rrmModernUiP485 button:not(#startScreen button):active,
body.rrmModernUiP485 .iconOnly:not(#startScreen .iconOnly):active{
  transform:translateY(1px);
}

body.rrmModernUiP485 button:not(#startScreen button).active,
body.rrmModernUiP485 .iconOnly:not(#startScreen .iconOnly).active{
  color:#fff7d8!important;
  border-color:var(--rrm-modern-gold-2)!important;
  background:
    radial-gradient(circle at 50% 0, rgba(255,228,138,.28), transparent 42%),
    linear-gradient(180deg, #1f6da8, #0b2d4e)!important;
}

body.rrmModernUiP485 .hudTop .iconOnly{
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  min-height:48px!important;
  max-width:48px!important;
  max-height:48px!important;
  flex:0 0 48px!important;
  padding:0!important;
}

body.rrmModernUiP485 .iconOnly[data-ui-sprite]:not(#speedBtn),
body.rrmModernUiP485 .panelTabs button[data-ui-sprite]{
  background-image:none!important;
  color:var(--rrm-modern-text)!important;
  font-size:0!important;
}

body.rrmModernUiP485 .uiSpriteIcon{
  width:28px!important;
  height:28px!important;
  flex:0 0 28px!important;
  background-size:contain!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  image-rendering:auto;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.55));
}

body.rrmModernUiP485 #speedBtn{
  min-width:74px!important;
  width:auto!important;
  height:48px!important;
  padding:0 11px!important;
  gap:6px!important;
  font-size:16px!important;
  color:var(--rrm-modern-text)!important;
}

body.rrmModernUiP485 #speedBtn .uiSpriteIcon{
  width:21px!important;
  height:21px!important;
  flex-basis:21px!important;
}

body.rrmModernUiP485 .hudBottom{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  min-height:70px!important;
  padding:8px!important;
  border-radius:20px!important;
}

body.rrmModernUiP485 .hudBottom .buttons{
  gap:8px!important;
  max-width:min(980px, calc(100vw - 36px))!important;
}

body.rrmModernUiP485 .hudBottom .iconOnly,
body.rrmModernUiP485 .mobileMenuBtn{
  width:108px!important;
  height:48px!important;
  min-width:108px!important;
  min-height:48px!important;
  max-width:108px!important;
  max-height:48px!important;
  flex:0 0 108px!important;
  padding:5px 7px!important;
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:7px!important;
  text-align:right!important;
}

body.rrmModernUiP485 .hudBottom .iconOnly .uiSpriteIcon,
body.rrmModernUiP485 .mobileMenuBtn .uiSpriteIcon{
  width:27px!important;
  height:27px!important;
  flex-basis:27px!important;
}

body.rrmModernUiP485 .rrmModernHudLabel{
  display:block!important;
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:none!important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:right!important;
  color:var(--rrm-modern-text)!important;
  font-size:10px!important;
  line-height:1.05!important;
  font-weight:900!important;
  text-shadow:0 1px 1px rgba(0,0,0,.72);
}

body.rrmModernUiP485 .buildMenu,
body.rrmModernUiP485 .panel:not(#workPanel){
  padding:16px!important;
  border-radius:26px!important;
}

body.rrmModernUiP485 #buildMenu{






}


body.rrmModernUiP485 #farmPanel,
body.rrmModernUiP485 #savePanel,
body.rrmModernUiP485 #researchPanel,
body.rrmModernUiP485 #eventsPanel,
body.rrmModernUiP485 #storyPanel,
body.rrmModernUiP485 #visitorsPanel,
body.rrmModernUiP485 #craftPanel,
body.rrmModernUiP485 #stockPanel,
body.rrmModernUiP485 #balancePanel,
body.rrmModernUiP485 #productionPanel,
body.rrmModernUiP485 #schedulePopup{
}

body.rrmModernUiP485 #workPanel{




  border-radius:26px!important;
}

body.rrmModernUiP485 #workPanel .wpHeader,
body.rrmModernUiP485 .buildMenu>h3,
body.rrmModernUiP485 .panel>h3,
body.rrmModernUiP485 .objectPopupHeader,
body.rrmModernUiP485 .sidePanelHeader{
  position:sticky!important;
  top:0!important;
  min-height:56px!important;
  margin:-16px -16px 14px -16px!important;
  padding:15px 66px 12px 18px!important;
  border-bottom:1px solid var(--rrm-modern-line-soft)!important;
  color:var(--rrm-modern-gold-2)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 99%,transparent), color-mix(in srgb,var(--bd-bg-secondary) 98%,transparent))!important;
  font-size:26px!important;
  font-weight:950!important;
  line-height:1.1!important;
  justify-content:center!important;
  text-align:center!important;
  text-shadow:0 2px 2px rgba(0,0,0,.75)!important;
}

body.rrmModernUiP485 .sidePanelHeader{
  margin:0!important;
}

body.rrmModernUiP485 .rrmPanelClose,
body.rrmModernUiP485 #wpClose,
body.rrmModernUiP485 #sideCloseBtn,
body.rrmModernUiP485 #objectPopupClose{
  position:absolute!important;
  top:9px!important;
  right:10px!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  flex-basis:44px!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 .rrmModernPanel{
    border-radius:22px!important;
  }

  body.rrmModernUiP485 :is(
    .buildMenu,
    .panel
  ) > h3,
  body.rrmModernUiP485 :is(
    .objectPopupHeader,
    .sidePanelHeader,
    .wpHeader,
    .panelHeader,
    .p42712Head
  ),
  body.rrmModernUiP485 #eventAlert.rrmModernPanel > .eventAlertTitle{
    min-height:48px!important;
    padding:12px 58px 10px 14px!important;
    font-size:20px!important;
  }
}

/* P6.02: compact build information and inspectable blueprint authority. */
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem{
  position:relative!important;
  min-width:0!important;
  height:84px!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem .rrmUnifiedBuildCard{
  width:100%!important;
  height:100%!important;
  padding-right:30px!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn{
  position:absolute!important;
  z-index:3!important;
  top:6px!important;
  right:6px!important;
  display:grid!important;
  place-items:center!important;
  width:24px!important;
  min-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  padding:0!important;
  border:1px solid rgba(147,197,253,.72)!important;
  border-radius:50%!important;
  background:#18324a!important;
  color:#dbeafe!important;
  box-shadow:0 1px 3px rgba(0,0,0,.34)!important;
  font:800 13px/1 system-ui,sans-serif!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn:hover,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn:focus-visible{
  border-color:var(--bd-warning)!important;
  background:#274c68!important;
  color:#fff7cc!important;
}

body.rrmModernUiP485 #objectPopup:is(.buildInfoObjectPopupP602,.blueprintObjectPopupP602){





}

body.rrmModernUiP485 #objectPopup:is(.buildInfoObjectPopupP602,.blueprintObjectPopupP602) #objectPopupBody{
  flex:0 1 auto!important;
  min-height:0!important;
  max-height:calc(100dvh - var(--rrm-topbar-height,44px) - var(--rrm-bottombar-height,52px) - 64px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

body.rrmModernUiP485 .rrmBuildInfoPopupP602,
body.rrmModernUiP485 .rrmBlueprintPopupP602{
  display:grid!important;
  gap:10px!important;
  min-width:0!important;
}

body.rrmModernUiP485 .rrmBuildInfoIdentity{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
  padding:2px 0 9px!important;
  border-bottom:1px solid color-mix(in srgb,var(--bd-border-soft) 50%,transparent)!important;
}

body.rrmModernUiP485 .rrmBuildInfoIdentity .rrmUnifiedBuildIcon{
  display:grid!important;
  place-items:center!important;
  width:38px!important;
  height:38px!important;
  flex:0 0 38px!important;
  border-radius:6px!important;
  background-color:color-mix(in srgb,var(--bd-border-soft) 34%,transparent)!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:contain!important;
  color:var(--bd-title)!important;
  font-size:18px!important;
}

body.rrmModernUiP485 .rrmBuildInfoIdentity strong{
  min-width:0!important;
  overflow-wrap:anywhere!important;
  color:var(--bd-title,#fff7d6)!important;
  font-size:15px!important;
}

body.rrmModernUiP485 :is(.rrmBuildInfoSection,.rrmBlueprintSectionP602){
  min-width:0!important;
  margin:0!important;
  padding:0 0 9px!important;
  border-bottom:1px solid color-mix(in srgb,var(--bd-border-soft,#ffffff) 30%,transparent)!important;
}

body.rrmModernUiP485 :is(.rrmBuildInfoSection,.rrmBlueprintSectionP602) h4{
  margin:0 0 6px!important;
  color:var(--bd-title,#9dc7e6)!important;
  font-size:11px!important;
  font-weight:900!important;
  letter-spacing:0!important;
  text-transform:uppercase!important;
}

body.rrmModernUiP485 .rrmBuildInfoSection p{
  margin:0!important;
  color:var(--bd-text,#f0f4f8)!important;
  line-height:1.45!important;
  overflow-wrap:anywhere!important;
}

body.rrmModernUiP485 .rrmBuildInfoMaterials{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}

body.rrmModernUiP485 .rrmBuildInfoMaterial{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  min-width:0!important;
  min-height:28px!important;
  padding:4px 8px!important;
  border:1px solid color-mix(in srgb,var(--bd-border-soft,#facc15) 64%,transparent)!important;
  border-radius:5px!important;
  background:color-mix(in srgb,var(--bd-surface,#2d3028) 84%,var(--bd-panel,#2d3028) 16%)!important;
  color:var(--bd-text)!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}

body.rrmModernUiP485 .rrmBuildInfoMaterial strong{color:var(--bd-title)!important;}
body.rrmModernUiP485 .rrmBuildInfoCostText{color:var(--bd-text)!important;}

body.rrmModernUiP485 .rrmBlueprintStatusP602{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-width:0!important;
  padding-bottom:9px!important;
  border-bottom:1px solid rgba(255,255,255,.1)!important;
}

body.rrmModernUiP485 .rrmBlueprintStatusDotP602{
  width:10px!important;
  height:10px!important;
  flex:0 0 10px!important;
  border-radius:50%!important;
  background:var(--bd-warning)!important;
  box-shadow:0 0 0 3px rgba(250,204,21,.15)!important;
}

body.rrmModernUiP485 .rrmBlueprintStatusP602 div{
  display:grid!important;
  gap:2px!important;
  min-width:0!important;
}

body.rrmModernUiP485 .rrmBlueprintStatusP602 small,
body.rrmModernUiP485 .rrmBlueprintBuilderP602 span{
  color:#aebdcc!important;
  font-size:10px!important;
  font-weight:800!important;
}

body.rrmModernUiP485 .rrmBlueprintStatusP602 strong{
  color:#fff6c7!important;
  overflow-wrap:anywhere!important;
}

body.rrmModernUiP485 .rrmBlueprintBuilderP602{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-width:0!important;
}

body.rrmModernUiP485 .rrmBlueprintBuilderP602 strong{
  min-width:0!important;
  color:var(--bd-text)!important;
  overflow-wrap:anywhere!important;
  text-align:right!important;
}

body.rrmModernUiP485 .rrmBlueprintMaterialRowP602{
  display:grid!important;
  grid-template-columns:10px minmax(0,1fr) auto auto!important;
  align-items:center!important;
  gap:7px!important;
  min-height:34px!important;
  padding:5px 0!important;
  border-bottom:1px solid rgba(255,255,255,.07)!important;
}

body.rrmModernUiP485 .rrmBlueprintMaterialRowP602:last-child{border-bottom:0!important;}
body.rrmModernUiP485 .rrmBlueprintMaterialRowP602 strong{min-width:0!important;overflow-wrap:anywhere!important;color:var(--bd-text)!important;}
body.rrmModernUiP485 .rrmBlueprintMaterialRowP602 > span:not(.rrmBlueprintMaterialStateP602){color:var(--bd-text-muted)!important;font-variant-numeric:tabular-nums!important;}
body.rrmModernUiP485 .rrmBlueprintMaterialRowP602 em{font-style:normal!important;font-size:10px!important;font-weight:800!important;color:#93c5a6!important;white-space:nowrap!important;}
body.rrmModernUiP485 .rrmBlueprintMaterialRowP602.missing em{color:#fca5a5!important;}

body.rrmModernUiP485 .rrmBlueprintMaterialStateP602{
  width:8px!important;
  height:8px!important;
  border-radius:50%!important;
  background:#5db77a!important;
}

body.rrmModernUiP485 .rrmBlueprintMaterialRowP602.available .rrmBlueprintMaterialStateP602{background:var(--bd-warning)!important;}
body.rrmModernUiP485 .rrmBlueprintMaterialRowP602.missing .rrmBlueprintMaterialStateP602{background:var(--bd-danger)!important;}
body.rrmModernUiP485 .rrmBlueprintNoMaterialsP602{color:var(--bd-text-muted)!important;padding:3px 0!important;}

body.rrmModernUiP485 .rrmBlueprintProgressHeaderP602{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
}

body.rrmModernUiP485 .rrmBlueprintProgressHeaderP602 h4{margin:0!important;}
body.rrmModernUiP485 .rrmBlueprintProgressHeaderP602 strong{color:#dbeafe!important;font-variant-numeric:tabular-nums!important;}

body.rrmModernUiP485 .rrmBlueprintProgressP602{
  width:100%!important;
  height:9px!important;
  margin-top:7px!important;
  overflow:hidden!important;
  border-radius:4px!important;
  background:#20262d!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bd-border-soft) 34%,transparent)!important;
}

body.rrmModernUiP485 .rrmBlueprintProgressP602 > div{
  height:100%!important;
  border-radius:4px!important;
  background:#58a6d8!important;
  transition:width .2s linear!important;
}

body.rrmModernUiP485 .rrmBlueprintActionsP602{
  display:flex!important;
  justify-content:flex-end!important;
  margin:0!important;
}

body.rrmModernUiP485 .rrmBlueprintActionsP602 .rrmDangerButtonP602{
  min-height:36px!important;
  border-color:#b94b4b!important;
  background:#6f2929!important;
  color:#fff!important;
  font-weight:900!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem{height:74px!important;}
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem .rrmUnifiedBuildCard{padding-right:27px!important;}
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn{top:5px!important;right:5px!important;width:22px!important;min-width:22px!important;height:22px!important;min-height:22px!important;font-size:12px!important;}
  body.rrmModernUiP485 .rrmBlueprintMaterialRowP602{grid-template-columns:10px minmax(0,1fr) auto!important;}
  body.rrmModernUiP485 .rrmBlueprintMaterialRowP602 em{grid-column:2 / -1!important;justify-self:start!important;white-space:normal!important;}
}

body.rrmModernUiP485 .rrmBuildTabs,
body.rrmModernUiP485 .panelTabs{
  display:flex!important;
  gap:10px!important;
  padding:0!important;
  margin:2px 0 14px 0!important;
  overflow-x:auto!important;
  scrollbar-width:none;
}

body.rrmModernUiP485 .rrmBuildTabs::-webkit-scrollbar,
body.rrmModernUiP485 .panelTabs::-webkit-scrollbar{display:none;}

body.rrmModernUiP485 .rrmBuildTabs button,
body.rrmModernUiP485 .panelTabs button{
  min-height:50px!important;
  min-width:136px!important;
  padding:8px 14px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  white-space:nowrap!important;
  color:var(--rrm-modern-muted)!important;
}

body.rrmModernUiP485 .rrmBuildTabs button.active,
body.rrmModernUiP485 .panelTabs button.active{
  color:var(--rrm-modern-gold-2)!important;
}

body.rrmModernUiP485 .buildSection{
  display:none!important;
}

body.rrmModernUiP485 .buildOptions,
body.rrmModernUiP485 #farmPanel .panelSection{
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(148px, 1fr))!important;
  gap:12px!important;
}

body.rrmModernUiP485 .rrmBuildCard{
  width:100%!important;
  height:148px!important;
  min-width:0!important;
  min-height:148px!important;
  max-width:none!important;
  max-height:none!important;
  flex:1 1 auto!important;
  padding:12px!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  align-items:center!important;
  justify-content:stretch!important;
  gap:5px 8px!important;
  font-size:0!important;
  text-align:right!important;
  border-radius:14px!important;
  overflow:visible!important;
  background:
    radial-gradient(circle at 50% 8%, color-mix(in srgb,var(--bd-border-soft) 50%,transparent), transparent 42%),
    linear-gradient(180deg, rgba(31,47,66,.98), rgba(13,25,38,.98))!important;
}

body.rrmModernUiP485 .rrmBuildCard .uiSpriteIcon{
  grid-column:1!important;
  grid-row:1 / span 2!important;
  justify-self:start!important;
  width:38px!important;
  height:38px!important;
  flex-basis:38px!important;
}

body.rrmModernUiP485 .rrmBuildLabel{
  display:block!important;
  grid-column:2!important;
  grid-row:1!important;
  min-width:0!important;
  width:100%!important;
  color:var(--rrm-modern-text)!important;
  font-size:14px!important;
  line-height:1.15!important;
  font-weight:950!important;
  text-align:right!important;
  overflow-wrap:anywhere!important;
}

body.rrmModernUiP485 .rrmBuildCost{
  display:block!important;
  grid-column:2!important;
  grid-row:2!important;
  min-width:0!important;
  width:100%!important;
  min-height:16px;
  color:var(--rrm-modern-muted)!important;
  font-size:11px!important;
  line-height:1.2!important;
  font-weight:800!important;
  text-align:right!important;
}

body.rrmModernUiP485 .panelSection,
body.rrmModernUiP485 .objectInfoLine,
body.rrmModernUiP485 .statRow,
body.rrmModernUiP485 .recipeButton,
body.rrmModernUiP485 .researchCard,
body.rrmModernUiP485 .eventCard,
body.rrmModernUiP485 .visitorCard,
body.rrmModernUiP485 .tradeOffer{
  color:var(--rrm-modern-text,#fff)!important;
  border:1px solid color-mix(in srgb,var(--bd-border) 35%,transparent)!important;
  border-radius:12px!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel-alt) 92%,transparent), color-mix(in srgb,var(--bd-panel) 90%,transparent))!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 22%,transparent), 0 6px 18px rgba(0,0,0,.22)!important;
}

body.rrmModernUiP485 .statRow{
  min-height:40px!important;
  padding:9px 11px!important;
}

body.rrmModernUiP485 .recipeButton,
body.rrmModernUiP485 .researchCard,
body.rrmModernUiP485 .visitorCard{
  width:100%!important;
  margin:8px 0!important;
  padding:12px!important;
}

body.rrmModernUiP485 .recipeButton{
  justify-content:flex-start!important;
  min-height:58px!important;
  color:var(--rrm-modern-text)!important;
}

body.rrmModernUiP485 .recipeButton:disabled{
  opacity:.48!important;
  filter:saturate(.5)!important;
}

body.rrmModernUiP485 table{
  border-collapse:separate!important;
  border-spacing:0!important;
}

body.rrmModernUiP485 th{
  color:var(--rrm-modern-gold-2)!important;
  background:rgba(8,16,27,.94)!important;
  border-bottom:1px solid var(--rrm-modern-line-soft)!important;
}

body.rrmModernUiP485 td{
  border-bottom:1px solid rgba(255,255,255,.06)!important;
}

body.rrmModernUiP485 .wpPrioBox,
body.rrmModernUiP485 .wpSmallBtn{
  min-width:48px!important;
  min-height:48px!important;
  border-radius:12px!important;
  font-size:20px!important;
}

body.rrmModernUiP485 .wpCell.on .wpPrioBox{
  color:#dfffc3!important;
  border-color:rgba(123,211,63,.58)!important;
}

body.rrmModernUiP485 .wpCell.off .wpPrioBox{
  color:rgba(255,255,255,.45)!important;
  border-color:rgba(255,255,255,.16)!important;
}

body.rrmModernUiP485 .sidePanel{
  border-radius:24px!important;
}

body.rrmModernUiP485 #panelContent{
  padding:14px!important;
}

body.rrmModernUiP485 .rrmColonistProfile{
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:14px;
  min-height:0;
  height:100%;
}

body.rrmModernUiP485 .rrmColonistSummaryRow{
  display:grid;
  grid-template-columns:minmax(0, .78fr) minmax(320px, 1.22fr);
  gap:14px;
  align-items:stretch;
}

body.rrmModernUiP485 .rrmColonistHero{
  display:grid;
  grid-template-columns:112px minmax(0,1fr);
  gap:14px;
  align-items:center;
}

body.rrmModernUiP485 .rrmColonistAvatar{
  width:112px;
  height:112px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:transparent;
  border:1px solid var(--rrm-modern-line-soft);
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
}

body.rrmModernUiP485 .rrmColonistAvatar img{
  width:92px;
  height:92px;
  object-fit:contain;
  image-rendering:auto;
}

body.rrmModernUiP485 .rrmAvatarFallback{
  font-size:46px;
  font-weight:950;
  color:var(--rrm-modern-gold-2);
}

body.rrmModernUiP485 .rrmColonistName{
  margin:0 0 8px 0;
  color:var(--rrm-modern-text);
  font-size:30px;
  line-height:1.05;
  font-weight:950;
}

body.rrmModernUiP485 .rrmColonistMeta{
  display:grid;
  gap:6px;
  color:var(--rrm-modern-muted);
  font-size:16px;
  font-weight:800;
}

body.rrmModernUiP485 .rrmStatGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 12px;
  padding:14px;
  border:1px solid color-mix(in srgb,var(--bd-border) 38%,transparent);
  border-radius:16px;
  background:rgba(8,16,27,.40);
}

body.rrmModernUiP485 .rrmNeedRow{
  display:grid;
  grid-template-columns:minmax(72px,90px) 1fr 42px;
  align-items:center;
  gap:8px;
  min-width:0;
  color:var(--rrm-modern-text);
  font-size:13px;
  font-weight:900;
}

body.rrmModernUiP485 .rrmNeedBar{
  height:18px;
  border-radius:999px;
  background:#08111b;
  border:1px solid var(--rrm-modern-line-soft);
  overflow:hidden;
  box-shadow:inset 0 2px 4px rgba(0,0,0,.45);
}

body.rrmModernUiP485 .rrmNeedFill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #65b82e, var(--rrm-modern-green));
}

body.rrmModernUiP485 .rrmNeedFill.warn{background:linear-gradient(90deg, #d18d18, var(--rrm-modern-warn));}
body.rrmModernUiP485 .rrmNeedFill.danger{background:linear-gradient(90deg, #b02f35, var(--rrm-modern-danger));}

body.rrmModernUiP485 .rrmColonistCards{
  display:grid;
  grid-template-columns:minmax(220px,.72fr) minmax(0,1.28fr);
  grid-template-rows:auto minmax(0,1fr);
  grid-template-areas:
    "status mood"
    "equipment inventory";
  gap:12px;
  min-height:0;
  align-items:stretch;
}

body.rrmModernUiP485 .rrmInfoCard{
  padding:13px;
  border:1px solid rgba(215,180,95,.25);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(25,39,56,.82), rgba(12,24,39,.82));
}

body.rrmModernUiP485 .rrmStatusCard{grid-area:status;min-width:0;}
body.rrmModernUiP485 .rrmColonistMoodSummary{grid-area:mood;min-width:0;align-self:stretch;}
body.rrmModernUiP485 .rrmEquipmentCard{grid-area:equipment;min-width:0;}
body.rrmModernUiP485 .rrmInventoryCard{grid-area:inventory;min-width:0;grid-column:auto;}

body.rrmModernUiP485 .rrmInfoCard h4{
  margin:0 0 10px 0;
  color:var(--rrm-modern-gold-2);
  font-size:18px;
}

body.rrmModernUiP485 .rrmInfoLine{
  display:flex;
  align-items:center;
  gap:8px;
  margin:6px 0;
  color:var(--rrm-modern-text);
  font-weight:800;
}
body.rrmModernUiP485 .rrmInfoLineLabel::after{
  content:":";
  margin-left:.08em;
  margin-right:.25em;
}

body.rrmModernUiP485 .rrmEquipmentGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

body.rrmModernUiP485 .rrmEquipmentSlot{
  min-width:0!important;
  min-height:58px!important;
  width:100%!important;
  padding:8px!important;
  border-radius:12px!important;
  border:1px solid rgba(215,180,95,.22)!important;
  background:color-mix(in srgb,var(--bd-bg) 62%,transparent)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  color:var(--rrm-modern-text)!important;
  text-align:center!important;
  overflow:hidden!important;
  touch-action:manipulation!important;
  user-select:none!important;
  -webkit-tap-highlight-color:transparent!important;
}

body.rrmModernUiP485 .rrmEquipmentSlot:hover,
body.rrmModernUiP485 .rrmEquipmentSlot.active{
  border-color:rgba(246,215,122,.62)!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 34%,transparent), 0 0 0 1px rgba(246,215,122,.12)!important;
}

body.rrmModernUiP485 .rrmEquipmentSlot.pending{
  border-color:rgba(235,169,72,.48)!important;
}

body.rrmModernUiP485 .rrmEquipmentSlot.pending .rrmEquipmentSlotIcon .rrmMiniSprite,
body.rrmModernUiP485 .rrmEquipmentSlot.requested .rrmEquipmentSlotIcon .rrmMiniSprite{
  filter:grayscale(1) saturate(.08) brightness(.92) drop-shadow(0 2px 2px rgba(0,0,0,.45));
  opacity:.82;
}

body.rrmModernUiP485 .rrmEquipmentSlot.equipped .rrmEquipmentSlotIcon .rrmMiniSprite{
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.45));
  opacity:1;
}

body.rrmModernUiP485 .rrmEquipmentSlotIcon{
  display:flex;
  align-items:center;
  justify-content:center;
}

body.rrmModernUiP485 .rrmEquipmentSlotIcon .rrmMiniSprite{
  width:var(--rrm-slot-icon-size,36px);
  height:var(--rrm-slot-icon-size,36px);
}

body.rrmModernUiP485 .rrmEquipmentSlotText{
  display:none!important;
  gap:1px;
  min-width:0;
  width:100%;
}

body.rrmModernUiP485 .rrmEquipmentSlotText strong,
body.rrmModernUiP485 .rrmEquipmentSlotText span,
body.rrmModernUiP485 .rrmEquipmentSlot small{
  display:none!important;
  min-width:0;
  max-width:100%;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmEquipmentSlotText strong{
  color:var(--rrm-modern-gold-2);
  font-size:11px;
  line-height:1.05;
  font-weight:950;
}

body.rrmModernUiP485 .rrmEquipmentSlotText span{
  font-size:10px;
  line-height:1.05;
  font-weight:850;
}

body.rrmModernUiP485 .rrmEquipmentSlot small{
  color:var(--rrm-modern-muted);
  font-size:9px;
  line-height:1;
  font-weight:850;
}

body.rrmModernUiP485 .rrmEquipmentChoice{
  min-width:0!important;
  min-height:36px!important;
  width:100%!important;
  padding:5px 8px!important;
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:7px!important;
  border-radius:10px!important;
  color:var(--rrm-modern-text)!important;
  text-align:left!important;
}

body.rrmModernUiP485 .rrmEquipmentChoice.clear{
  grid-template-columns:minmax(0,1fr)!important;
}

body.rrmModernUiP485 .rrmEquipmentChoice.selected{
  border-color:rgba(123,211,63,.58)!important;
  color:#dfffc3!important;
}

body.rrmModernUiP485 .rrmEquipmentChoice .rrmMiniSprite{
  width:22px;
  height:22px;
}

body.rrmModernUiP485 .rrmEquipmentChoice span{
  min-width:0;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  font-size:12px;
  font-weight:900;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmEquipmentChoice small{
  color:var(--rrm-modern-muted);
  font-size:10px;
  font-weight:850;
  white-space:nowrap;
}

body.rrmModernUiP485 .rrmEquipmentPopup{
  z-index:var(--rrm-z-modal-secondary)!important;




  padding:0!important;
  display:flex!important;
  flex-direction:column!important;

  border-radius:18px!important;
}

body.rrmModernUiP485 .rrmEquipmentPopupHeader{
  position:sticky!important;
  top:0!important;
  z-index:1!important;
  min-height:50px!important;
  padding:13px 58px 11px 14px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-bottom:1px solid var(--rrm-modern-line-soft)!important;
  color:var(--rrm-modern-gold-2)!important;
  background:linear-gradient(180deg, color-mix(in srgb,var(--bd-panel) 99%,transparent), color-mix(in srgb,var(--bd-bg-secondary) 98%,transparent))!important;
  font-size:20px!important;
  font-weight:950!important;
  text-align:center!important;
}

body.rrmModernUiP485 .rrmEquipmentPopupChoices{
  padding:10px!important;
  display:grid!important;
  gap:7px!important;
  overflow:auto!important;
}

body.rrmModernUiP485 .rrmInventoryGrid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:10px;
}

body.rrmModernUiP485 .rrmInventorySlot{
  min-height:70px;
  border-radius:14px;
  border:1px solid rgba(215,180,95,.22);
  background:color-mix(in srgb,var(--bd-bg) 62%,transparent);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

body.rrmModernUiP485 .rrmInventorySlot .rrmMiniSprite{
  width:var(--rrm-slot-icon-size,40px);
  height:var(--rrm-slot-icon-size,40px);
  max-width:calc(100% - 12px);
  max-height:calc(100% - 12px);
}

body.rrmModernUiP485 .rrmInventoryQty{
  position:absolute;
  right:var(--rrm-slot-qty-inset,7px);
  bottom:var(--rrm-slot-qty-inset,5px);
  color:var(--rrm-modern-text);
  font-size:var(--rrm-slot-qty-size,15px);
  font-weight:950;
  text-shadow:0 2px 2px rgba(0,0,0,.85);
}

body.rrmModernUiP485 .rrmMiniSprite{
  display:inline-block;
  width:24px;
  height:24px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  flex:0 0 auto;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.45));
}

@media (max-width:860px), (pointer:coarse){
  /* P6.2 - o foco do popup pode compactar seu proprio conteudo, mas nunca
     redimensionar nem ocultar controles das HUDs persistentes. */
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanel,
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanel.open{


  }

body.rrmModernUiP485 :is(#objectPopupClose,#sideCloseBtn,#wpClose,.rrmPanelClose).hasUiSpriteIcon{
  color:transparent!important;
  font-size:0!important;
  text-shadow:none!important;
}
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanelHeader{
    position:absolute!important;
    top:8px!important;
    right:8px!important;
    z-index:4!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    background:none!important;
    border:0!important;
    justify-content:flex-end!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanelTitle{
    display:none!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #sideCloseBtn.iconOnly{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
    flex-basis:34px!important;
    font-size:14px!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanel .panelTabs{
    gap:5px!important;
    padding:8px 10px 6px 10px!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanel .panelTabs button{
    min-width:0!important;
    min-height:32px!important;
    padding:5px 7px!important;
    font-size:11px!important;
    gap:4px!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent{
    padding:7px 9px 9px 9px!important;
  }
  body.rrmModernUiP485 .hudTop{
    left:6px!important;
    right:6px!important;
    min-height:54px!important;
    border-radius:16px!important;
  }
  body.rrmModernUiP485 .hudTop .iconOnly,
  body.rrmModernUiP485 #speedBtn{
    width:40px!important;
    height:42px!important;
    min-width:40px!important;
    min-height:42px!important;
    max-width:40px!important;
    max-height:42px!important;
    flex-basis:40px!important;
    padding:0!important;
  }
  body.rrmModernUiP485 #speedBtn{
    min-width:60px!important;
    padding:0 7px!important;
    font-size:13px!important;
  }
  body.rrmModernUiP485 .hudTop .iconPill{
    height:42px!important;
    min-height:42px!important;
    padding:6px 8px!important;
    font-size:12px!important;
  }
  body.rrmModernUiP485 .hudTop .widePill{
    min-width:260px!important;
  }
  body.rrmModernUiP485 .hudBottom{
    left:6px!important;
    right:6px!important;
    transform:none!important;
    min-height:118px!important;
    border-radius:18px!important;
  }
  body.rrmModernUiP485 .hudBottom .buttons{
    display:grid!important;
    grid-template-columns:repeat(4, minmax(0,1fr))!important;
    width:100%!important;
    max-width:none!important;
    gap:7px!important;
  }
  body.rrmModernUiP485 .hudBottom .iconOnly,
  body.rrmModernUiP485 .mobileMenuBtn{
    width:100%!important;
    height:50px!important;
    min-width:0!important;
    min-height:50px!important;
    max-width:none!important;
    max-height:50px!important;
    flex:1 1 auto!important;
  }
  body.rrmModernUiP485 .hudBottom .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .mobileMenuBtn .uiSpriteIcon{
    width:24px!important;
    height:24px!important;
    flex-basis:24px!important;
  }
  body.rrmModernUiP485 .buildMenu,
  body.rrmModernUiP485 .panel,
  body.rrmModernUiP485 #workPanel,
  body.rrmModernUiP485 .sidePanel,
  body.rrmModernUiP485 .sidePanel.open,
  body.rrmModernUiP485 .objectPopup{




    border-radius:22px!important;
  }
  body.rrmModernUiP485 .buildOptions,
  body.rrmModernUiP485 #farmPanel .panelSection{
    grid-template-columns:repeat(2, minmax(0,1fr))!important;
    gap:9px!important;
  }
  body.rrmModernUiP485 .rrmBuildCard{
    min-height:118px!important;
    height:118px!important;
    padding:9px!important;
  }
  body.rrmModernUiP485 .rrmBuildCard .uiSpriteIcon{
    width:44px!important;
    height:44px!important;
    flex-basis:44px!important;
  }
  body.rrmModernUiP485 .rrmBuildLabel{font-size:13px!important;}
  body.rrmModernUiP485 .rrmBuildCost{font-size:10px!important;}
  body.rrmModernUiP485 .rrmColonistHero{
    grid-template-columns:84px minmax(0,1fr);
    align-items:start;
  }
  body.rrmModernUiP485 .rrmColonistAvatar{
    width:84px;
    height:84px;
    border-radius:15px;
  }
  body.rrmModernUiP485 .rrmColonistAvatar img{
    width:72px;
    height:72px;
  }
  body.rrmModernUiP485 .rrmColonistName{
    font-size:24px;
  }
  body.rrmModernUiP485 .rrmColonistSummaryRow{
    grid-template-columns:minmax(0, 1.05fr) minmax(0, .95fr);
    gap:12px;
    align-items:start;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistProfile{
    gap:10px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistSummaryRow{
    grid-template-columns:minmax(0, .70fr) minmax(0, 1.30fr);
    gap:8px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistHero{
    grid-template-columns:68px minmax(0,1fr);
    gap:10px;
    align-items:start;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistAvatar{
    width:68px;
    min-width:68px!important;
    max-width:68px!important;
    height:68px;
    flex-basis:68px!important;
    border-radius:14px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistAvatar img{
    width:58px;
    height:58px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistName{
    margin:0 0 5px 0;
    font-size:18px;
    line-height:1.02;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMeta{
    gap:4px;
    font-size:11px;
    line-height:1.12;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmMiniSprite{
    width:18px;
    height:18px;
  }
  body.rrmModernUiP485 .rrmStatGrid{
    grid-template-columns:1fr;
    gap:8px;
    padding:12px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmStatGrid{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:5px;
    padding:7px;
    border-radius:14px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
      "label value"
      "bar bar";
    gap:2px 4px;
    font-size:9px;
    line-height:1.05;
    padding:3px 4px;
    border-radius:9px;
    background:rgba(4,10,18,.34);
    border:1px solid rgba(255,255,255,.06);
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > span{
    grid-area:label;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  overflow-wrap:anywhere;}
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > strong{
    grid-area:value;
    font-size:9px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedBar{
    grid-area:bar;
    height:8px;
    margin-top:0;
  }
  body.rrmModernUiP485 .rrmColonistCards{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistCards{
    grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr);
    grid-template-rows:auto minmax(0,1fr);
    grid-template-areas:
      "status mood"
      "equipment inventory";
    gap:7px;
    align-items:stretch;
    min-height:0;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryCard{
    grid-column:auto;
  }
  body.rrmModernUiP485 .rrmInfoCard{
    padding:11px;
    border-radius:14px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoCard{
    padding:7px 8px;
    border-radius:12px;
  }
  body.rrmModernUiP485 .rrmInfoCard h4{
    margin-bottom:8px;
    font-size:16px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoCard h4{
    margin-bottom:4px;
    font-size:12px;
  }
  body.rrmModernUiP485 .rrmInfoLine{
    gap:6px;
    margin:4px 0;
    font-size:13px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoLine{
    gap:4px;
    margin:2px 0;
    font-size:10px;
    line-height:1.08;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryCard h4{
    margin-bottom:5px;
  }
  body.rrmModernUiP485 .rrmInventoryGrid{
    grid-template-columns:repeat(5, minmax(0,1fr));
    gap:8px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryGrid{
    gap:4px;
  }
  body.rrmModernUiP485 .rrmInventorySlot{
    min-height:58px;
    border-radius:12px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventorySlot{
    min-height:34px;
    border-radius:8px;
  }
  body.rrmModernUiP485 .rrmInventorySlot .rrmMiniSprite{
    width:var(--rrm-slot-icon-size,32px);
    height:var(--rrm-slot-icon-size,32px);
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventorySlot .rrmMiniSprite{
    width:var(--rrm-slot-icon-size,32px)!important;
    height:var(--rrm-slot-icon-size,32px)!important;
    max-width:calc(100% - 10px)!important;
    max-height:calc(100% - 10px)!important;
  }
  body.rrmModernUiP485 .rrmInventoryQty{
    right:5px;
    bottom:4px;
    font-size:13px;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryQty{
    font-size:var(--rrm-slot-qty-size,10px)!important;
    right:var(--rrm-slot-qty-inset,3px)!important;
    bottom:var(--rrm-slot-qty-inset,3px)!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="structure"] .panelSection{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px;
    padding:8px;
    margin:0;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="structure"] .panelSection > b{
    grid-column:1 / -1;
    margin-bottom:2px;
    font-size:12px;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="structure"] .statRow{
    margin:0;
    padding:5px 6px;
    border:1px solid color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
    border-radius:10px;
    background:rgba(9,17,28,.48);
    font-size:10px;
    line-height:1.08;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"]{
    display:grid;
    grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);
    gap:8px;
    align-items:start;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"] .panelSection{
    margin:0;
    padding:8px;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"] .panelSection > b{
    margin-bottom:4px;
    font-size:12px;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"] .statRow{
    padding:4px 0;
    font-size:10px;
    line-height:1.08;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"] .logLine{
    padding:4px 0;
    font-size:10px;
    line-height:1.1;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="log"] .panelSection{
    margin:0;
    padding:8px;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="log"] .panelSection > b{
    margin-bottom:4px;
    font-size:12px;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="log"] .logLine{
    padding:4px 0;
    font-size:10px;
    line-height:1.14;
  }
}

@media (max-width:520px){
  body.rrmModernUiP485 .hudTop .widePill{
    min-width:225px!important;
  }
  body.rrmModernUiP485 .hudTop .iconOnly,
  body.rrmModernUiP485 #speedBtn{
    min-width:38px!important;
    width:38px!important;
  }
  body.rrmModernUiP485 #speedBtn{
    min-width:56px!important;
  }
  body.rrmModernUiP485 .rrmModernHudLabel{
    font-size:9px!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile .sidePanel .panelTabs button{
    font-size:10px!important;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="work"]{
    grid-template-columns:1fr;
  }
  body.rrmModernUiP485.rrmSidePanelFocusMobile #panelContent[data-modern-tab="structure"] .panelSection{
    grid-template-columns:1fr;
  }
}

@media (max-width:620px) and (orientation:portrait){
  body.rrmModernUiP485 .rrmColonistSummaryRow,
  body.rrmModernUiP485 .rrmColonistCards{
    grid-template-columns:1fr;
  }
}

body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard,
body.rrmModernUiP485 #farmPanel .panelSection .rrmBuildCard{
  width:100%!important;
  height:148px!important;
  min-width:0!important;
  min-height:148px!important;
  max-width:none!important;
  max-height:none!important;
  flex:1 1 auto!important;
  gap:7px!important;
}

body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon,
body.rrmModernUiP485 #farmPanel .panelSection .rrmBuildCard .uiSpriteIcon{
  width:38px!important;
  height:38px!important;
  flex-basis:38px!important;
}

body.rrmModernUiP485 #farmPanel .panelSection{
  grid-template-columns:repeat(5,64px)!important;
  justify-content:center!important;
  gap:10px!important;
}

body.rrmModernUiP485 #farmPanel .panelSection .rrmBuildCard.rrmFarmIconButton{
  width:64px!important;
  height:64px!important;
  min-width:64px!important;
  min-height:64px!important;
  max-width:64px!important;
  max-height:64px!important;
  padding:7px!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}

body.rrmModernUiP485 #farmPanel .panelSection .rrmFarmIconButton .uiSpriteIcon{
  width:48px!important;
  height:48px!important;
  flex:0 0 48px!important;
}

body.rrmModernUiP485 #farmPanel .rrmFarmIconButton .rrmBuildLabel,
body.rrmModernUiP485 #farmPanel .rrmFarmIconButton .rrmBuildCost{
  display:none!important;
}

body.rrmModernUiP485 .hudBottom .buttons .iconOnly.hasUiSpriteIcon.uiSpriteOnly,
body.rrmModernUiP485 .hudBottom .buttons .mobileMenuBtn.hasUiSpriteIcon.uiSpriteOnly{
  gap:3px!important;
  overflow:visible!important;
}

body.rrmModernUiP485 .hudBottom .buttons > .iconOnly{
  display:none!important;
}

body.rrmModernUiP485 .hudBottom .buttons > #markBtn,
body.rrmModernUiP485 .hudBottom .buttons > #buildBtn,
body.rrmModernUiP485 .hudBottom .buttons > #researchBtn,
body.rrmModernUiP485 .hudBottom .buttons > #visitorsBtn,
body.rrmModernUiP485 .hudBottom .buttons > #workBtn,
body.rrmModernUiP485 .hudBottom .buttons > #externalMapBtn,
body.rrmModernUiP485 .hudBottom .buttons > #mobileMenuBtn{
  display:inline-flex!important;
}

body.rrmModernUiP485 .hudBottom > :not(.buttons){
  display:none!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard,
  body.rrmModernUiP485 #farmPanel .panelSection .rrmBuildCard{
    height:118px!important;
    min-height:118px!important;
    max-height:none!important;
    gap:5px!important;
  }
  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon,
  body.rrmModernUiP485 #farmPanel .panelSection .rrmBuildCard .uiSpriteIcon{
    width:42px!important;
    height:42px!important;
    flex-basis:42px!important;
  }
  body.rrmModernUiP485 .hudBottom{
    min-height:126px!important;
  }
  body.rrmModernUiP485 .hudBottom .buttons .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons .mobileMenuBtn{
    height:54px!important;
    min-height:54px!important;
    max-height:54px!important;
  }
  body.rrmModernUiP485 .hudBottom .buttons .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .hudBottom .buttons .mobileMenuBtn .uiSpriteIcon{
    width:23px!important;
    height:23px!important;
    flex-basis:23px!important;
  }
  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel{
    font-size:10px!important;
    line-height:1.1!important;
  }
}

/* P4.88 - mobile target is landscape: compact chrome, icon-only bottom HUD. */
@media (orientation: landscape) and (max-height:520px) and (max-width:960px){
  :root{
    --rrm-bottombar-height:56px;
  }

  body.rrmModernUiP485 .hudBottom{
    min-height:56px!important;
    padding:6px!important;
    border-radius:16px!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons{
    display:grid!important;
    grid-template-columns:repeat(7, minmax(0,1fr))!important;
    gap:6px!important;
    width:100%!important;
    max-width:none!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons .mobileMenuBtn{
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding:0!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .hudBottom .buttons .mobileMenuBtn .uiSpriteIcon{
    width:30px!important;
    height:30px!important;
    flex-basis:30px!important;
  }

  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel{
    display:none!important;
  }

  body.rrmModernUiP485 #buildMenu{


    padding:10px!important;

  }

  body.rrmModernUiP485 #buildMenu > h3{
    min-height:42px!important;
    margin:-10px -10px 8px -10px!important;
    padding:9px 58px 8px 14px!important;
    font-size:22px!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmPanelClose{
    top:7px!important;
    right:9px!important;
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    flex-basis:36px!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildTabs{
    gap:8px!important;
    margin:0 0 8px 0!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildTabs button{
    min-height:34px!important;
    min-width:132px!important;
    padding:5px 10px!important;
    font-size:11px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions{
    grid-template-columns:repeat(auto-fill, minmax(108px, 126px))!important;
    gap:8px!important;
    justify-content:center!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard{
    height:78px!important;
    min-height:78px!important;
    width:148px!important;
    max-width:148px!important;
    padding:6px!important;
    gap:3px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon{
    width:28px!important;
    height:28px!important;
    flex-basis:28px!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildLabel{
    font-size:11px!important;
    line-height:1.05!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildCost{
    font-size:9px!important;
    line-height:1!important;
  }
}

/* P4.118 - compact mobile information surfaces. */
body.rrmModernUiP485 #buildMenu .buildOptions button.rrmBuildFilterHidden,
body.rrmModernUiP485 #buildMenu .buildOptions button[hidden]{
  display:none!important;
}

body.rrmModernUiP485 .sidePanel.rrmColonistOnlyPopup .panelTabs{
  display:none!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .sidePanel .panelTabs,
body.rrmModernUiP485 #panelContent[data-modern-tab="colonist"] ~ .panelTabs{
  display:none!important;
}

body.rrmModernUiP485 .sidePanel.rrmColonistOnlyPopup #panelContent{
  padding-top:10px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmStatGrid{
  grid-template-columns:repeat(3, minmax(0,1fr))!important;
  gap:5px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow{
  min-height:34px!important;
  padding:3px 4px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > span{
  font-size:8.5px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > strong{
  font-size:8.5px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedBar{
  height:7px!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistCards{
  grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  grid-template-areas:
    "status mood"
    "equipment inventory"!important;
  align-items:stretch!important;
  min-height:0!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoCard{
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryCard{
  display:flex!important;
  flex-direction:column!important;
}

body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryGrid{
  flex:1 1 auto!important;
  align-items:stretch!important;
}

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventorySlot{
    min-height:0!important;
    height:38px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentCard{
    display:flex!important;
    flex-direction:column!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentGrid{
    grid-template-columns:repeat(3, minmax(0,1fr))!important;
    gap:4px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlot{
    min-height:0!important;
    height:38px!important;
    gap:0!important;
    padding:4px!important;
    border-radius:8px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlotIcon .rrmMiniSprite{
    width:var(--rrm-slot-icon-size,32px)!important;
    height:var(--rrm-slot-icon-size,32px)!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlotText strong{
    font-size:7.5px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlotText span{
    display:none!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlot small{
    font-size:6.8px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentChoice{
    min-height:28px!important;
    grid-template-columns:18px minmax(0,1fr) auto!important;
    gap:5px!important;
    padding:4px 6px!important;
    border-radius:8px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentChoice .rrmMiniSprite{
    width:17px!important;
    height:17px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentChoice span{
    font-size:10px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentChoice small{
    font-size:8px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentPopup{








  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentPopupHeader{
    min-height:44px!important;
    padding:10px 52px 9px 12px!important;
    font-size:16px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentPopupChoices{
    padding:8px!important;
    gap:6px!important;
  }

body.rrmModernUiP485 #craftPanel{
}

body.rrmModernUiP485 #craftList{
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftScreen,
body.rrmModernUiP485 .rrmCraftGroup{
  display:grid;
  gap:10px;
}

body.rrmModernUiP485 .rrmCraftGroupTitle{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--rrm-modern-gold-2);
  font-size:15px;
  font-weight:950;
}

body.rrmModernUiP485 .rrmCraftGroupTitle .rrmCraftStationSprite{
  width:26px;
  height:26px;
}

body.rrmModernUiP485 .rrmCraftWorkbench{
  display:grid;
  grid-template-columns:minmax(220px, 260px) minmax(0,1fr);
  gap:10px;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftStationSummary{
  grid-column:1 / -1;
}

body.rrmModernUiP485 .rrmCraftStationColumn{
  display:grid;
  align-content:start;
  gap:8px;
}

body.rrmModernUiP485 .rrmCraftStationCard,
body.rrmModernUiP485 .rrmCraftRecipeTable,
body.rrmModernUiP485 .rrmCraftEmpty{
  border:1px solid var(--rrm-modern-line-soft);
  border-radius:12px;
  background:linear-gradient(180deg,var(--rrm-modern-card-2),var(--rrm-modern-card));
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--rrm-modern-text) 8%,transparent),0 6px 18px color-mix(in srgb,var(--rrm-modern-bg) 48%,transparent);
}

body.rrmModernUiP485 .rrmCraftStationCard{
  min-height:76px;
  padding:10px;
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:8px;
  align-items:center;
}

body.rrmModernUiP485 .rrmCraftStationSprite{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  flex:0 0 auto;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.45));
}

body.rrmModernUiP485 .rrmCraftStationText strong,
body.rrmModernUiP485 .rrmCraftRecipeName b{
  display:block;
  color:var(--rrm-modern-text);
  font-size:13px;
  line-height:1.1;
  font-weight:950;
}

body.rrmModernUiP485 .rrmCraftStationText small,
body.rrmModernUiP485 .rrmCraftRecipeName small,
body.rrmModernUiP485 .rrmCraftStationMeta,
body.rrmModernUiP485 .rrmCraftTinyMeta{
  color:var(--rrm-modern-muted);
  font-size:10px;
  line-height:1.15;
  font-style:normal;
}

body.rrmModernUiP485 .rrmCraftStationMeta{
  grid-column:1 / -1;
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}

body.rrmModernUiP485 .rrmCraftStationMeta span,
body.rrmModernUiP485 .rrmCraftTinyLabel,
body.rrmModernUiP485 .rrmCraftQueueEmpty,
body.rrmModernUiP485 .rrmCraftQueueMore{
  border:1px solid var(--rrm-modern-line-soft);
  border-radius:8px;
  padding:2px 6px;
  background:var(--rrm-modern-panel);
  color:var(--rrm-modern-muted);
  font-size:10px;
  font-weight:900;
}

body.rrmModernUiP485 .rrmCraftAutoSummary{
  grid-template-columns:1fr auto;
  min-height:58px;
}

body.rrmModernUiP485 .rrmCraftAutoSummary strong{
  color:var(--rrm-modern-gold-2);
  font-size:24px;
  line-height:1;
}

body.rrmModernUiP485 .rrmCraftQueuePanel{
  grid-template-columns:1fr!important;
  align-items:stretch;
  min-height:0;
  gap:7px;
}

body.rrmModernUiP485 .rrmCraftQueueTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftQueueTitle small{
  color:var(--rrm-modern-muted);
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
}

body.rrmModernUiP485 .rrmCraftQueueList{
  display:grid;
  gap:5px;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftQueueItem{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto;
  align-items:center;
  gap:6px;
  min-width:0;
  min-height:34px;
  padding:4px 5px;
  border:1px solid var(--rrm-modern-line-soft);
  border-radius:8px;
  background:var(--rrm-modern-panel);
}

body.rrmModernUiP485 .rrmCraftQueueItem .recipeSprite,
body.rrmModernUiP485 .rrmCraftQueueItem .rrmCraftItemIcon{
  width:26px!important;
  height:26px!important;
  flex:0 0 26px!important;
  margin:0!important;
}

body.rrmModernUiP485 .rrmCraftQueueItem span{
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftQueueItem b{
  display:block;
  overflow:visible;
  color:var(--rrm-modern-text);
  font-size:10px;
  font-weight:950;
  line-height:1.1;
  text-overflow:clip;
  white-space:normal;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmCraftQueueItem small{
  color:var(--rrm-modern-muted);
  font-size:9px;
  font-weight:900;
}

body.rrmModernUiP485 .rrmCraftQueueItem button{
  width:17px!important;
  height:17px!important;
  min-width:20px!important;
  min-height:20px!important;
  padding:0!important;
  border-radius:7px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .rrmCraftRecipeTable{
  overflow:hidden;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftHeader,
body.rrmModernUiP485 .rrmCraftRecipeRow{
  display:grid;
  grid-template-columns:minmax(150px,1.35fr) minmax(150px,1fr) minmax(96px,.72fr) 84px;
  gap:8px;
  align-items:center;
}

body.rrmModernUiP485 .rrmCraftHeader{
  min-height:34px;
  padding:8px 10px;
  color:var(--rrm-modern-gold-2);
  font-size:11px;
  font-weight:950;
  border-bottom:1px solid var(--rrm-modern-line-soft);
  background:var(--rrm-modern-panel);
}

body.rrmModernUiP485 .rrmCraftRecipeRow{
  min-height:58px;
  padding:7px 10px;
  border-bottom:1px solid var(--rrm-modern-line-soft);
}

body.rrmModernUiP485 .rrmCraftRecipeRow:last-child{
  border-bottom:0;
}

body.rrmModernUiP485 .rrmCraftRecipeRow.isDisabled{
  opacity:.58;
}

body.rrmModernUiP485 .rrmCraftRecipeName{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftRecipeName .recipeSprite,
body.rrmModernUiP485 .rrmCraftItemIcon{
  width:34px!important;
  height:34px!important;
  flex:0 0 34px!important;
  margin:0!important;
}

body.rrmModernUiP485 .rrmCraftMaterials,
body.rrmModernUiP485 .rrmCraftResult,
body.rrmModernUiP485 .rrmCraftQueueCell{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftChip,
body.rrmModernUiP485 .rrmCraftQueuePill{
  min-height:32px;
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1px solid var(--rrm-modern-line-soft);
  border-radius:8px;
  padding:3px 6px;
  background:var(--rrm-modern-panel);
  color:var(--rrm-modern-text);
  font-size:10px;
  font-weight:950;
}

body.rrmModernUiP485 .rrmCraftChip small{
  color:var(--rrm-modern-muted);
  font-size:9px;
}

body.rrmModernUiP485 .rrmCraftFallbackIcon{
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  background:color-mix(in srgb,var(--rrm-modern-gold-2) 16%,transparent);
  color:var(--rrm-modern-gold-2);
  font-size:12px;
  font-weight:950;
}

body.rrmModernUiP485 .rrmCraftQueuePill .recipeSprite{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px!important;
  margin:0!important;
}

body.rrmModernUiP485 .rrmCraftQueuePill button{
  width:17px!important;
  height:17px!important;
  min-width:20px!important;
  min-height:20px!important;
  padding:0!important;
  border-radius:7px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .rrmCraftProduceBtn{
  min-height:34px!important;
  padding:6px 8px!important;
  border-radius:9px!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:11px!important;
  font-weight:950!important;
}

body.rrmModernUiP485 #objectPopup .rrmCraftWorkbench{
  grid-template-columns:minmax(0,1fr);
}

body.rrmModernUiP485 #objectPopup .rrmCraftStationColumn{
  grid-template-columns:minmax(0,1fr);
}

body.rrmModernUiP485 #objectPopup .rrmCraftStationCard:first-child{
  grid-column:1 / -1;
}

body.rrmModernUiP485 #objectPopup .rrmCraftHeader,
body.rrmModernUiP485 #objectPopup .rrmCraftRecipeRow{
  grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,.72fr) 72px;
}

body.rrmModernUiP485 #objectPopup .rrmCraftHeader > *,
body.rrmModernUiP485 #objectPopup .rrmCraftRecipeRow > *{
  min-width:0;
}

body.rrmModernUiP485 .rrmCraftEmpty{
  min-height:54px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--rrm-modern-muted);
  font-weight:850;
}

body.rrmModernUiP485 .rrmCraftMuted{
  color:var(--rrm-modern-muted);
  font-size:10px;
  font-weight:850;
}

body.rrmModernUiP485 .autoProductionP317{
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(160px,1fr))!important;
  gap:8px!important;
  padding:10px!important;
}

body.rrmModernUiP485 .autoProductionP317 > b{
  grid-column:1 / -1;
  color:var(--rrm-modern-gold-2);
  font-size:13px;
}

body.rrmModernUiP485 .autoProductionP317 .autoProdCardP317{
  margin:0!important;
  padding:8px!important;
  border-radius:10px!important;
}

body.rrmModernUiP485 .autoProductionP317 .statRow{
  min-height:28px!important;
  padding:5px 7px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .autoProductionP317 .objectActionRow button{
  min-height:28px!important;
  padding:4px 7px!important;
  border-radius:8px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup{

}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup #objectPopupBody{
  padding:0!important;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyPopupTitleRowP102459{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  max-width:100%;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyPopupTitleTextP102459{
  display:block;
  min-width:0;
  overflow:hidden;
  color:inherit;
  font:inherit;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459{
  box-sizing:border-box!important;
  flex:0 0 42px;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  display:grid!important;
  place-items:center;
  padding:7px!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  box-shadow:none!important;
  cursor:pointer;
  touch-action:manipulation;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459 img{
  display:block;
  width:26px;
  height:26px;
  object-fit:contain;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459:hover{
  background:color-mix(in srgb,var(--rrm-modern-text) 9%,transparent)!important;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459:focus-visible{
  outline:2px solid var(--bd-focus);
  outline-offset:2px;
}

body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459[hidden]{
  display:none!important;
}

body.rrmModernUiP485 .rrmColonyOverview{
  display:grid;
  gap:10px;
}

body.rrmModernUiP485 .rrmColonySummaryGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:8px;
}

body.rrmModernUiP485 .rrmColonySummaryCard,
body.rrmModernUiP485 .rrmColonyPanel{
  border:1px solid color-mix(in srgb,var(--bd-border) 42%,transparent);
  border-radius:12px;
  background:linear-gradient(180deg,var(--rrm-modern-card-2),var(--rrm-modern-card));
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--rrm-modern-text) 8%,transparent),0 6px 18px color-mix(in srgb,var(--rrm-modern-bg) 48%,transparent);
}

body.rrmModernUiP485 .rrmColonySummaryCard{
  min-height:74px;
  padding:9px;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:8px;
  align-items:center;
}

body.rrmModernUiP485 .rrmColonyCardIcon{
  width:38px;
  height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--rrm-modern-panel);
}

body.rrmModernUiP485 .rrmColonyCardIcon img{
  display:block;
  width:30px;
  height:30px;
  object-fit:contain;
  image-rendering:pixelated;
}

body.rrmModernUiP485 .rrmColonySummaryCard small,
body.rrmModernUiP485 .rrmColonySummaryCard em,
body.rrmModernUiP485 .rrmColonyPawnRow small,
body.rrmModernUiP485 .rrmColonyAlertRow small{
  display:block;
  color:var(--rrm-modern-muted);
  font-size:11px;
  line-height:1.15;
  font-style:normal;
}

body.rrmModernUiP485 .rrmColonySummaryCard strong{
  display:block;
  color:var(--rrm-modern-text);
  font-size:21px;
  line-height:1.02;
  font-weight:950;
}

body.rrmModernUiP485 .rrmColonySummaryCard.good strong,
body.rrmModernUiP485 .rrmColonyMood.good{
  color:var(--rrm-modern-green);
}

body.rrmModernUiP485 .rrmColonySummaryCard.warn strong,
body.rrmModernUiP485 .rrmColonyMood.warn{
  color:var(--rrm-modern-warn);
}

body.rrmModernUiP485 .rrmColonySummaryCard.bad strong,
body.rrmModernUiP485 .rrmColonyMood.bad{
  color:var(--rrm-modern-danger);
}

body.rrmModernUiP485 .rrmColonyMainGrid{
  display:grid;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
  gap:10px;
}

body.rrmModernUiP485 .rrmColonyPanel{
  min-height:210px;
  padding:10px;
}

body.rrmModernUiP485 .rrmColonyPanel h4{
  margin:0 0 8px 0;
  color:var(--rrm-modern-gold-2);
  font-size:15px;
}

body.rrmModernUiP485 .rrmColonyPawnRow,
body.rrmModernUiP485 .rrmColonyAlertRow{
  min-height:42px;
  display:grid;
  align-items:center;
  gap:8px;
  padding:6px 4px;
  border-bottom:1px solid color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
}

body.rrmModernUiP485 .rrmColonyPawnRow{
  grid-template-columns:34px minmax(0,1fr) auto 34px;
}

body.rrmModernUiP485 .rrmColonyAlertRow{
  grid-template-columns:32px minmax(0,1fr);
}

body.rrmModernUiP485 .rrmColonyPawnRow:last-child,
body.rrmModernUiP485 .rrmColonyAlertRow:last-child{
  border-bottom:0;
}

body.rrmModernUiP485 .rrmColonyPawnAvatar,
body.rrmModernUiP485 .rrmColonyAlertRow > span{
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:color-mix(in srgb,var(--bd-bg) 62%,transparent);
  color:var(--rrm-modern-gold-2);
  font-weight:950;
}

body.rrmModernUiP485 .rrmColonyPawnAvatar{
  overflow:hidden;
  padding:0;
  border:1px solid color-mix(in srgb,var(--bd-border) 52%,transparent);
}

body.rrmModernUiP485 .rrmColonyPawnAvatar img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  image-rendering:pixelated;
}

body.rrmModernUiP485 .rrmColonyPawnRow b,
body.rrmModernUiP485 .rrmColonyAlertRow b{
  color:var(--rrm-modern-text);
  font-size:13px;
}

body.rrmModernUiP485 .rrmColonyMood{
  font-size:12px;
  font-weight:950;
}

body.rrmModernUiP485 .rrmColonyDraftBtnP64249{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  padding:0!important;
  display:grid!important;
  place-items:center;
  border-radius:9px!important;
  border:1px solid rgba(148,163,184,.32)!important;
  background:color-mix(in srgb,var(--bd-bg) 62%,transparent)!important;
  color:#dbeafe!important;
  font-size:15px!important;
  line-height:1!important;
}
body.rrmModernUiP485 .rrmColonyDraftBtnP64249.active{
  border-color:rgba(147,197,253,.88)!important;
  background:rgba(30,64,120,.92)!important;
  color:#fff!important;
}
body.rrmModernUiP485 .rrmColonyPawnRow.drafted{
  background:rgba(30,64,120,.16);
}
body.rrmModernUiP485 .rrmColonyDraftBtnP64249:disabled{
  opacity:.35;
  filter:grayscale(1);
}

body.rrmModernUiP485 .rrmColonyAlertRow.critical > span{
  color:#fff;
  background:var(--rrm-modern-danger);
}

body.rrmModernUiP485 .rrmColonyAlertRow.warning > span{
  color:#201500;
  background:var(--rrm-modern-warn);
}

body.rrmModernUiP485 .rrmColonyEmpty{
  color:var(--rrm-modern-muted);
  font-size:12px;
  font-weight:850;
}

@media (orientation: landscape) and (max-height:520px) and (max-width:960px){
  body.rrmModernUiP485 #craftPanel{


    padding:10px!important;
  }

  body.rrmModernUiP485 #craftPanel > h3{
    min-height:38px!important;
    margin:-10px -10px 8px -10px!important;
    padding:8px 56px 8px 14px!important;
    font-size:19px!important;
  }

  body.rrmModernUiP485 .rrmCraftGroupTitle{
    display:none;
  }

  body.rrmModernUiP485 .rrmCraftScreen{
    gap:8px;
  }

  body.rrmModernUiP485 .rrmCraftWorkbench{
    grid-template-columns:160px minmax(0,1fr);
    gap:8px;
  }

  body.rrmModernUiP485 .rrmCraftStationCard{
    min-height:56px;
    padding:7px;
    grid-template-columns:34px minmax(0,1fr);
  }

  body.rrmModernUiP485 .rrmCraftStationSprite{
    width:32px;
    height:32px;
  }

  body.rrmModernUiP485 .rrmCraftStationText strong,
  body.rrmModernUiP485 .rrmCraftRecipeName b{
    font-size:11px;
  }

  body.rrmModernUiP485 .rrmCraftStationText small,
  body.rrmModernUiP485 .rrmCraftRecipeName small,
  body.rrmModernUiP485 .rrmCraftStationMeta,
  body.rrmModernUiP485 .rrmCraftTinyMeta{
    font-size:9px;
  }

  body.rrmModernUiP485 .rrmCraftHeader,
  body.rrmModernUiP485 .rrmCraftRecipeRow{
    grid-template-columns:minmax(118px,1.25fr) minmax(128px,1fr) minmax(86px,.68fr) 68px;
    gap:5px;
  }

  body.rrmModernUiP485 .rrmCraftHeader{
    min-height:26px;
    padding:5px 7px;
    font-size:9px;
  }

  body.rrmModernUiP485 .rrmCraftRecipeRow{
    min-height:46px;
    padding:5px 7px;
  }

  body.rrmModernUiP485 .rrmCraftRecipeName .recipeSprite,
  body.rrmModernUiP485 .rrmCraftItemIcon{
    width:26px!important;
    height:26px!important;
    flex-basis:26px!important;
  }

  body.rrmModernUiP485 .rrmCraftChip,
  body.rrmModernUiP485 .rrmCraftQueuePill{
    min-height:25px;
    padding:2px 4px;
    font-size:9px;
  }

  body.rrmModernUiP485 .rrmCraftQueuePanel{
    gap:5px;
  }

  body.rrmModernUiP485 .rrmCraftQueueItem{
    grid-template-columns:24px minmax(0,1fr) auto;
    gap:4px;
    min-height:30px;
    padding:3px 4px;
  }

  body.rrmModernUiP485 .rrmCraftQueueItem .recipeSprite,
  body.rrmModernUiP485 .rrmCraftQueueItem .rrmCraftItemIcon{
    width:22px!important;
    height:22px!important;
    flex-basis:22px!important;
  }

  body.rrmModernUiP485 .rrmCraftQueueItem b{
    font-size:9px;
  }

  body.rrmModernUiP485 .rrmCraftProduceBtn{
    min-height:28px!important;
    padding:4px 5px!important;
    font-size:9px!important;
  }

  body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup{







  }

  body.rrmModernUiP485 .rrmColonySummaryGrid{
    gap:6px;
  }

  body.rrmModernUiP485 .rrmColonySummaryCard{
    min-height:58px;
    padding:7px;
    grid-template-columns:34px minmax(0,1fr);
  }

  body.rrmModernUiP485 .rrmColonyCardIcon{
    width:30px;
    height:30px;
  }

  body.rrmModernUiP485 .rrmColonyCardIcon img{
    width:24px;
    height:24px;
  }

  body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459{
    flex-basis:40px;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    padding:7px!important;
  }

  body.rrmModernUiP485 #objectPopup.rrmColonyOverviewPopup .rrmColonyTitleActionBtnP102459 img{
    width:24px;
    height:24px;
  }

  body.rrmModernUiP485 .rrmColonySummaryCard strong{
    font-size:17px;
  }

  body.rrmModernUiP485 .rrmColonySummaryCard small,
  body.rrmModernUiP485 .rrmColonySummaryCard em,
  body.rrmModernUiP485 .rrmColonyPawnRow small,
  body.rrmModernUiP485 .rrmColonyAlertRow small{
    font-size:9.5px;
  }

  body.rrmModernUiP485 .rrmColonyPanel{
    min-height:158px;
    padding:8px;
  }

  body.rrmModernUiP485 .rrmColonyPawnRow,
  body.rrmModernUiP485 .rrmColonyAlertRow{
    min-height:34px;
    padding:4px 2px;
  }
}

/* P4.118 final override: close buttons keep only the sprite. */
body.rrmModernUiP485 #sideCloseBtn.iconOnly,
body.rrmModernUiP485.rrmSidePanelFocusMobile #sideCloseBtn.iconOnly,
body.rrmModernUiP485 #objectPopupClose.iconOnly,
body.rrmModernUiP485 #wpClose.iconOnly,
body.rrmModernUiP485 .rrmPanelClose{
  font-size:0!important;
  line-height:0!important;
  color:transparent!important;
  text-shadow:none!important;
  overflow:hidden!important;
}

/* ========================================================================
   P5.47 — Popup layout stability and title-screen configuration panels
   Scope: presentation only. Gameplay, jobs and save schema are unchanged.
   ======================================================================== */
:root{
  --rrm-title-popup-top:clamp(98px,18vh,130px);
  --rrm-title-popup-bottom:clamp(62px,11vh,80px);
  --rrm-title-popup-side:clamp(18px,2vw,32px);
  --rrm-title-popup-left:var(--rrm-title-popup-side);
  --rrm-title-popup-right:clamp(52px,5.5vw,104px);
  --rrm-title-popup-width:min(39vw,590px);
}

/* New game and Settings now share the visual footprint of the title menu. */
#settingsScreen.settingsScreen:not(.hidden),
#mapSetupScreen.mapSetupScreen:not(.hidden){
  position:fixed!important;
  inset:0!important;
  z-index:var(--rrm-z-screen)!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:flex-end!important;
  box-sizing:border-box!important;
  padding:var(--rrm-title-popup-top) var(--rrm-title-popup-right) var(--rrm-title-popup-bottom) var(--rrm-title-popup-left)!important;
  overflow:hidden!important;
  background:var(--bd-bg) url("../assets/intro_screen.png") center center / cover no-repeat!important;
}
#settingsScreen .settingsBackdrop,
#mapSetupScreen .mapSetupBackdrop{
  pointer-events:none!important;
  background:linear-gradient(90deg,rgba(3,7,18,.86),rgba(3,7,18,.50),rgba(3,7,18,.78))!important;
}
#settingsScreen .settingsCard,
#mapSetupScreen .mapSetupCard{
  position:relative!important;
  z-index:2!important;
  width:var(--rrm-title-popup-width)!important;
  min-width:0!important;
  height:min(650px,calc(100dvh - var(--rrm-title-popup-top) - var(--rrm-title-popup-bottom)))!important;
  max-height:calc(100dvh - var(--rrm-title-popup-top) - var(--rrm-title-popup-bottom))!important;
  margin:0!important;
  padding:18px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  box-sizing:border-box!important;
  border-radius:20px!important;
  background:linear-gradient(145deg,rgba(20,38,58,.96),rgba(7,16,28,.96))!important;
  border:1px solid rgba(214,179,113,.62)!important;
  box-shadow:0 20px 70px rgba(0,0,0,.64),inset 0 0 0 1px color-mix(in srgb,var(--bd-border-soft) 22%,transparent)!important;
}
#settingsScreen .mapBackBtn,
#mapSetupScreen .mapBackBtn{
  position:absolute!important;
  top:12px!important;
  right:12px!important;
  float:none!important;
  z-index:3!important;
  min-height:34px!important;
  padding:6px 10px!important;
  border-radius:10px!important;
  font-size:12px!important;
  white-space:nowrap!important;
}
#settingsScreen .startKicker,
#mapSetupScreen .startKicker{
  margin:0 104px 4px 0!important;
  font-size:10px!important;
  letter-spacing:.14em!important;
}
#settingsScreen .settingsCard h1,
#mapSetupScreen .mapSetupCard h1{
  margin:2px 104px 6px 0!important;
  font-size:clamp(21px,2vw,27px)!important;
  line-height:1.05!important;
  letter-spacing:.045em!important;
}
#settingsScreen .settingsCard>p,
#mapSetupScreen .mapSetupCard>p{
  margin:0 0 10px!important;
  color:var(--bd-text-muted)!important;
  font-size:12px!important;
  line-height:1.38!important;
}

/* Compact controls make the same title-panel frame practical without losing touch targets. */
#settingsScreen .settingsSection{
  margin:8px 0!important;
  padding:10px!important;
  border-radius:12px!important;
}
#settingsScreen .settingsSection h2{
  margin:0 0 7px!important;
  font-size:12px!important;
}
#settingsScreen .settingsGrid{
  grid-template-columns:repeat(auto-fit,minmax(128px,1fr))!important;
  gap:8px!important;
}
#settingsScreen .settingsGrid label,
#settingsScreen .settingsCheckRow{
  gap:4px!important;
  font-size:11px!important;
}
#settingsScreen .settingsCheckRow{
  min-height:34px!important;
  padding:7px 8px!important;
  gap:7px!important;
  border-radius:9px!important;
}
#settingsScreen .settingsCheckRow input{
  width:15px!important;
  height:15px!important;
}
#settingsScreen .settingsGrid select{
  min-height:32px!important;
  padding:6px 8px!important;
  border-radius:8px!important;
  font-size:12px!important;
}
#settingsScreen .settingsRangeLine{gap:8px!important;}
#settingsScreen .settingsHint{
  margin-top:6px!important;
  font-size:10px!important;
  line-height:1.3!important;
}
#settingsScreen .settingsActions{
  margin-top:10px!important;
  gap:8px!important;
}
#settingsScreen .settingsActions .startBtn{
  min-height:34px!important;
  padding:7px 11px!important;
  font-size:12px!important;
}
#settingsScreen .settingsStatus{
  margin-top:7px!important;
  font-size:10px!important;
}

#mapSetupScreen .mapSetupOptions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  margin:10px 0!important;
  padding:10px!important;
  border-radius:12px!important;
}
#mapSetupScreen .mapSetupOptions>label,
#mapSetupScreen .startGrid3>label{
  min-width:0!important;
  font-size:11px!important;
  line-height:1.25!important;
}
#mapSetupScreen .startGrid3{
  grid-column:1/-1!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
}
#mapSetupScreen .mapSetupOptions select,
#mapSetupScreen .mapSetupOptions input{
  width:100%!important;
  min-height:32px!important;
  margin-top:4px!important;
  padding:6px 8px!important;
  box-sizing:border-box!important;
  border-radius:8px!important;
  font-size:12px!important;
}
#mapSetupScreen .startActions{
  display:flex!important;
  gap:8px!important;
  margin-top:10px!important;
}
#mapSetupScreen .startActions .startBtn{
  min-height:36px!important;
  padding:7px 11px!important;
  font-size:12px!important;
}

/* Gameplay popup shells have a compact persistent header. */
body.rrmModernUiP485 #researchPanel>h3,
body.rrmModernUiP485 #buildMenu>h3{
  min-height:42px!important;
  margin:-12px -12px 9px!important;
  padding:9px 52px 8px 14px!important;
  justify-content:flex-start!important;
  text-align:left!important;
  font-size:22px!important;
  line-height:1.05!important;
}
body.rrmModernUiP485 #researchPanel .rrmPanelClose,
body.rrmModernUiP485 #buildMenu .rrmPanelClose{
  top:6px!important;
  right:8px!important;
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  border-radius:11px!important;
}
body.rrmModernUiP485 #researchPanel.rrmResearchPanelP423{
  padding:12px!important;
}
body.rrmModernUiP485 #researchPanel #researchList .rrmResearchSection{
  margin:6px 0!important;
}
body.rrmModernUiP485 #researchPanel #researchList .rrmResearchQueueRowP510{
  margin-top:5px!important;
  padding:7px!important;
}

/* Construction cards are deliberately narrower and shorter to fit more content per view. */
body.rrmModernUiP485 #buildMenu .buildOptions{
  grid-template-columns:repeat(auto-fill,minmax(148px,168px))!important;
  justify-content:start!important;
  gap:9px!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildCard,
body.rrmModernUiP485 #buildMenu .buildItem{
  min-height:124px!important;
  height:124px!important;
  padding:9px!important;
  gap:5px!important;
  border-radius:13px!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildCard .buildIcon,
body.rrmModernUiP485 #buildMenu .buildItem .buildIcon,
body.rrmModernUiP485 #buildMenu .rrmBuildCard img,
body.rrmModernUiP485 #buildMenu .buildItem img{
  max-width:46px!important;
  max-height:46px!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildCard b,
body.rrmModernUiP485 #buildMenu .rrmBuildCard .buildName,
body.rrmModernUiP485 #buildMenu .buildItem b,
body.rrmModernUiP485 #buildMenu .buildItem .buildName{
  font-size:13px!important;
  line-height:1.08!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildCard small,
body.rrmModernUiP485 #buildMenu .buildItem small,
body.rrmModernUiP485 #buildMenu .rrmBuildCard .buildCost,
body.rrmModernUiP485 #buildMenu .buildItem .buildCost{
  font-size:10px!important;
  line-height:1.05!important;
}

@media (max-width:860px){
  :root{
    --rrm-title-popup-top:max(8px,env(safe-area-inset-top,0px));
    --rrm-title-popup-bottom:max(8px,env(safe-area-inset-bottom,0px));
    --rrm-title-popup-side:max(8px,env(safe-area-inset-left,0px));
    --rrm-title-popup-left:max(8px,env(safe-area-inset-left,0px));
    --rrm-title-popup-right:max(8px,env(safe-area-inset-right,0px));
    --rrm-title-popup-width:100%;
  }
  #settingsScreen.settingsScreen:not(.hidden),
  #mapSetupScreen.mapSetupScreen:not(.hidden){
    padding:var(--rrm-title-popup-top) var(--rrm-title-popup-right) var(--rrm-title-popup-bottom) var(--rrm-title-popup-left)!important;
  }
  #settingsScreen .settingsCard,
  #mapSetupScreen .mapSetupCard{
    width:100%!important;
    height:calc(100dvh - var(--rrm-title-popup-top) - var(--rrm-title-popup-bottom))!important;
    max-height:calc(100dvh - var(--rrm-title-popup-top) - var(--rrm-title-popup-bottom))!important;
    padding:15px!important;
    border-radius:14px!important;
  }
  #settingsScreen .settingsGrid,
  #mapSetupScreen .mapSetupOptions{
    grid-template-columns:1fr!important;
  }
  #mapSetupScreen .startGrid3{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.rrmModernUiP485 #buildMenu .buildOptions{grid-template-columns:repeat(auto-fill,minmax(148px,1fr))!important;}
}

@media (max-width:460px){
  #mapSetupScreen .startGrid3{grid-template-columns:1fr!important;}
}

/* P5.47: actual build-card nodes produced by modern_ui_skin_system.js. */
body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon{
  width:38px!important;
  height:38px!important;
  flex-basis:38px!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildLabel{
  font-size:13px!important;
  line-height:1.08!important;
}
body.rrmModernUiP485 #buildMenu .rrmBuildCost{
  min-height:12px!important;
  font-size:10px!important;
  line-height:1.05!important;
}

/* ========================================================================
   P5.48 — popup shell correction
   The visual HUD is measured by popup_layout_manager.js. These rules only
   preserve the fixed shell and keep the close affordance above scroll content.
   ======================================================================== */
body.rrmModernUiP485 .rrmPopupManagedP424.rrmPopupFixedShellP548{
  transition:none!important;
  animation:none!important;
}
body.rrmModernUiP485 #buildMenu.rrmPopupFixedShellP548,
body.rrmModernUiP485 #researchPanel.rrmPopupFixedShellP548{
  /* Display is controlled by the popup manager / selection handlers. */
  flex-direction:column!important;


}
body.rrmModernUiP485 #buildMenu.rrmPopupFixedShellP548 > h3,
body.rrmModernUiP485 #researchPanel.rrmPopupFixedShellP548 > h3,
body.rrmModernUiP485 #buildMenu.rrmPopupFixedShellP548 > .rrmBuildTabs{
  flex:0 0 auto!important;
}
body.rrmModernUiP485 #buildMenu.rrmPopupFixedShellP548 > .buildOptions{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  padding-right:2px!important;
}
body.rrmModernUiP485 #researchPanel.rrmPopupFixedShellP548 #researchList{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  padding-right:2px!important;
}
/* The red sprite close buttons stay in the hit-testing layer even when their
   original glyph is replaced by a visual sprite. */
body.rrmModernUiP485 :is(.rrmPanelClose,#sideCloseBtn,#objectPopupClose,#wpClose,#stockPanelClose,#scheduleCloseBtn){
  z-index:60!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}
body.rrmModernUiP485 :is(.rrmPanelClose,#sideCloseBtn,#objectPopupClose,#wpClose,#stockPanelClose,#scheduleCloseBtn) .uiSpriteIcon{
  pointer-events:none!important;
}

/* ========================================================================
   P5.49 — Compact mobile type scale
   Uses a small, high-contrast game UI scale for phone landscape without
   changing popup dimensions, tap targets, jobs, or save data.
   ======================================================================== */
:root{
  --rrm-type-tiny:10px;
  --rrm-type-small:11px;
  --rrm-type-control:12px;
  --rrm-type-label:13px;
  --rrm-type-card-title:14px;
  --rrm-type-popup-title:21px;
  --rrm-type-hud:13px;
}

@media (max-width:960px), (pointer:coarse){
  /* Keep the information hierarchy compact: title > label > description. */
  body.rrmModernUiP485 .hudTop .iconPill,
  body.rrmModernUiP485 #speedBtn,
  body.rrmModernUiP485 .gameVersionLabel{
    font-size:var(--rrm-type-hud)!important;
    line-height:1.05!important;
  }

  body.rrmModernUiP485 :is(#buildMenu,#researchPanel,.sidePanel,#workPanel,.objectPopup) > h3,
  body.rrmModernUiP485 :is(#buildMenu,#researchPanel) > h3,
  body.rrmModernUiP485 .sidePanelHeader,
  body.rrmModernUiP485 .objectPopupHeader,
  body.rrmModernUiP485 .wpHeader > h3{
    font-size:var(--rrm-type-popup-title)!important;
    line-height:1.04!important;
  }

  /* Tabs and item actions stay compact while preserving their touch height. */
  body.rrmModernUiP485 .rrmBuildTabs button,
  body.rrmModernUiP485 .panelTabs button,
  body.rrmModernUiP485 #researchList button,
  body.rrmModernUiP485 #researchList button[data-research-action],
  body.rrmModernUiP485 .rrmResearchActionRowP4214 button{
    font-size:var(--rrm-type-control)!important;
    line-height:1.08!important;
  }

  /* Construction: compact names, tiny cost metadata. */
  body.rrmModernUiP485 #buildMenu .rrmBuildLabel,
  body.rrmModernUiP485 #buildMenu .rrmBuildCard b,
  body.rrmModernUiP485 #buildMenu .rrmBuildCard .buildName,
  body.rrmModernUiP485 #buildMenu .buildItem b,
  body.rrmModernUiP485 #buildMenu .buildItem .buildName{
    font-size:var(--rrm-type-label)!important;
    line-height:1.08!important;
  }
  body.rrmModernUiP485 #buildMenu .rrmBuildCost,
  body.rrmModernUiP485 #buildMenu .rrmBuildCard small,
  body.rrmModernUiP485 #buildMenu .rrmBuildCard .buildCost,
  body.rrmModernUiP485 #buildMenu .buildItem small,
  body.rrmModernUiP485 #buildMenu .buildItem .buildCost{
    font-size:var(--rrm-type-tiny)!important;
    line-height:1.05!important;
  }

  /* Research cards: 14px name, 10–11px supporting information. */
  body.rrmModernUiP485 #researchList .rrmResearchTitleP4214 > b,
  body.rrmModernUiP485 #researchList .rrmResearchTitleP42111 > b,
  body.rrmModernUiP485 #researchList .researchCard > b{
    font-size:var(--rrm-type-card-title)!important;
    line-height:1.1!important;
  }
  body.rrmModernUiP485 #researchList .rrmResearchTitleP4214 small,
  body.rrmModernUiP485 #researchList .rrmResearchTitleP42111 small,
  body.rrmModernUiP485 #researchList .rrmResearchWideP4212,
  body.rrmModernUiP485 #researchList .rrmResearchWideP4212 small,
  body.rrmModernUiP485 #researchList .rrmResearchStatRowP4212 span{
    font-size:var(--rrm-type-tiny)!important;
    line-height:1.18!important;
  }
  body.rrmModernUiP485 #researchList .rrmResearchInfoChipP4215 span,
  body.rrmModernUiP485 #researchList .rrmResearchProgressInlineP4215 span,
  body.rrmModernUiP485 #researchList .rrmResearchProgressInlineP4215 small,
  body.rrmModernUiP485 #researchList .rrmResearchChipP42111 span{
    font-size:var(--rrm-type-tiny)!important;
  }
  body.rrmModernUiP485 #researchList .rrmResearchInfoChipP4215 b,
  body.rrmModernUiP485 #researchList .rrmResearchProgressInlineP4215 b,
  body.rrmModernUiP485 #researchList .rrmResearchChipP42111 b,
  body.rrmModernUiP485 #researchList .rrmResearchPctP42111{
    font-size:var(--rrm-type-small)!important;
  }

  /* Colonist details use short, game-style labels without shrinking below 10px. */
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistName{
    font-size:18px!important;
    line-height:1.02!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMeta{
    font-size:var(--rrm-type-small)!important;
    line-height:1.12!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > span,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmNeedRow > strong,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoLine,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryQty{
    font-size:var(--rrm-type-tiny)!important;
    line-height:1.08!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInfoCard h4{
    font-size:var(--rrm-type-control)!important;
    line-height:1.08!important;
  }

  /* Generic compact metadata used by object, craft and management popups. */
  body.rrmModernUiP485 .panelSection small,
  body.rrmModernUiP485 .objectInfoLine small,
  body.rrmModernUiP485 .logLine small,
  body.rrmModernUiP485 .rrmCraftStationText small,
  body.rrmModernUiP485 .rrmCraftRecipeName small,
  body.rrmModernUiP485 .rrmCraftStationMeta,
  body.rrmModernUiP485 .rrmCraftTinyMeta{
    font-size:var(--rrm-type-tiny)!important;
    line-height:1.15!important;
  }
}


/* ========================================================================
   P5.50 — Area routing and construction card consistency
   ======================================================================== */
/* Selected build items close the catalog immediately. A visible fixed shell
   stays flex, while explicit hidden state wins over every historic selector. */
body.rrmModernUiP485 :is(#buildMenu,#researchPanel).rrmPopupFixedShellP548[style*="display: none"],
body.rrmModernUiP485 :is(#buildMenu,#researchPanel).rrmPopupFixedShellP548[style*="display:none"]{
  display:none!important;
}

/* Uniform compact construction cards. Grid tracks have a fixed maximum instead
   of filling the remaining row width, so no item becomes a random wide button. */
body.rrmModernUiP485 #buildMenu .buildOptions{
  grid-template-columns:repeat(auto-fill, minmax(148px, 168px))!important;
  justify-content:start!important;
  align-content:start!important;
  gap:8px!important;
}
body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard,
body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:112px!important;
  min-height:112px!important;
}
body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard.rrmManagedControlP424,
body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem.rrmManagedControlP424{
  min-width:0!important;
}
@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #buildMenu .buildOptions{
    grid-template-columns:repeat(auto-fill, minmax(104px, 118px))!important;
    gap:7px!important;
  }
  body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard,
  body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem{
    height:104px!important;
    min-height:104px!important;
    padding:7px!important;
  }
}

/* ========================================================================
   P5.53 - Compact HUD and popup pass
   Keeps the frontier skin, but spends less permanent screen space.
   ======================================================================== */
:root{
  --rrm-topbar-height:42px;
  --rrm-bottombar-height:52px;
  --rrm-type-tiny:9px;
  --rrm-type-small:10px;
  --rrm-type-control:11px;
  --rrm-type-label:12px;
  --rrm-type-card-title:13px;
  --rrm-type-popup-title:18px;
  --rrm-type-hud:12px;
}

body.rrmModernUiP485 .hudTop{
  min-height:44px!important;
  padding:5px!important;
  gap:5px!important;
  border-radius:12px!important;
  border-width:1px!important;
  box-shadow:0 8px 22px rgba(0,0,0,.30), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 22%,transparent)!important;
}

body.rrmModernUiP485 .hudTop .iconPill{
  height:34px!important;
  min-height:34px!important;
  padding:5px 8px!important;
  gap:5px!important;
  border-radius:10px!important;
  font-size:var(--rrm-type-hud)!important;
}

body.rrmModernUiP485 .hudTop .iconPill .ico,
body.rrmModernUiP485 .hudTop .rrmHudPngIcon{
  width:17px!important;
  height:17px!important;
  min-width:20px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .hudTop .widePill{
  min-width:260px!important;
  max-width:360px!important;
}

body.rrmModernUiP485 .hudTop .iconOnly,
body.rrmModernUiP485 .hudTop #saveBtn,
body.rrmModernUiP485 .hudTop #infoBtn,
body.rrmModernUiP485 .hudTop #zoomIn,
body.rrmModernUiP485 .hudTop #zoomOut,
body.rrmModernUiP485 .hudTop #pauseBtn{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  min-height:34px!important;
  max-width:34px!important;
  max-height:34px!important;
  flex:0 0 34px!important;
  border-radius:9px!important;
  font-size:12px!important;
}

body.rrmModernUiP485 #speedBtn{
  min-width:56px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 8px!important;
  border-radius:9px!important;
  font-size:12px!important;
}

body.rrmModernUiP485 .hudBottom{
  min-height:52px!important;
  padding:5px!important;
  gap:6px!important;
  border-radius:14px!important;
  border-width:1px!important;
  box-shadow:0 10px 26px rgba(0,0,0,.34), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 22%,transparent)!important;
}

body.rrmModernUiP485 .hudBottom .buttons{
  gap:5px!important;
  max-width:min(820px, calc(100vw - 32px))!important;
}

body.rrmModernUiP485 .hudBottom .iconOnly,
body.rrmModernUiP485 .mobileMenuBtn{
  width:58px!important;
  height:42px!important;
  min-width:58px!important;
  min-height:42px!important;
  max-width:58px!important;
  max-height:42px!important;
  flex:0 0 58px!important;
  padding:4px!important;
  gap:1px!important;
  border-radius:10px!important;
}

body.rrmModernUiP485 .hudBottom .iconOnly .uiSpriteIcon,
body.rrmModernUiP485 .mobileMenuBtn .uiSpriteIcon{
  width:22px!important;
  height:22px!important;
  flex-basis:22px!important;
}

body.rrmModernUiP485 .rrmModernHudLabel{
  font-size:9px!important;
  line-height:1!important;
  font-weight:850!important;
}

body.rrmModernUiP485 .gameVersionLabel{
  height:24px!important;
  min-width:44px!important;
  padding:3px 7px!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .buildMenu,
body.rrmModernUiP485 .panel:not(#workPanel){
  padding:10px!important;
  border-radius:16px!important;
}

body.rrmModernUiP485 .rrmModernPanel{
  border-width:1px!important;
  border-radius:16px!important;
  box-shadow:0 14px 38px rgba(0,0,0,.42), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 22%,transparent)!important;
}

body.rrmModernUiP485 #workPanel .wpHeader,
body.rrmModernUiP485 .buildMenu>h3,
body.rrmModernUiP485 .panel>h3,
body.rrmModernUiP485 .objectPopupHeader,
body.rrmModernUiP485 .sidePanelHeader,
body.rrmModernUiP485 #eventAlert.rrmModernPanel > .eventAlertTitle{
  min-height:38px!important;
  margin:-10px -10px 8px -10px!important;
  padding:8px 44px 7px 12px!important;
  justify-content:flex-start!important;
  text-align:left!important;
  font-size:var(--rrm-type-popup-title)!important;
  line-height:1.05!important;
}

body.rrmModernUiP485 .sidePanelHeader,
body.rrmModernUiP485 .objectPopupHeader,
body.rrmModernUiP485 #workPanel .wpHeader{
  margin:0!important;
}

body.rrmModernUiP485 #workPanel .wpHeader > h3{
  font-size:var(--rrm-type-popup-title)!important;
  line-height:1.05!important;
}

body.rrmModernUiP485 :is(.rrmPanelClose,#wpClose,#sideCloseBtn,#objectPopupClose,#stockPanelClose,#scheduleCloseBtn){
  top:5px!important;
  right:6px!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  flex-basis:30px!important;
  border-radius:9px!important;
}

body.rrmModernUiP485 .rrmBuildTabs,
body.rrmModernUiP485 .panelTabs{
  gap:6px!important;
  margin:0 0 8px 0!important;
}

body.rrmModernUiP485 .rrmBuildTabs button,
body.rrmModernUiP485 .panelTabs button{
  min-height:34px!important;
  min-width:88px!important;
  padding:6px 9px!important;
  gap:5px!important;
  font-size:var(--rrm-type-control)!important;
}

body.rrmModernUiP485 .panelSection,
body.rrmModernUiP485 .objectInfoLine,
body.rrmModernUiP485 .statRow,
body.rrmModernUiP485 .recipeButton,
body.rrmModernUiP485 .researchCard,
body.rrmModernUiP485 .eventCard,
body.rrmModernUiP485 .visitorCard{
  border-radius:8px!important;
  margin:4px 0!important;
}

body.rrmModernUiP485 .panelSection{
  padding:6px!important;
  font-size:var(--rrm-type-small)!important;
}

body.rrmModernUiP485 .panelSection b{
  margin-bottom:4px!important;
  font-size:var(--rrm-type-label)!important;
}

body.rrmModernUiP485 .statRow,
body.rrmModernUiP485 .objectInfoLine{
  min-height:28px!important;
  padding:4px 6px!important;
  gap:6px!important;
  font-size:var(--rrm-type-small)!important;
}

body.rrmModernUiP485 .logLine{
  padding:4px 0!important;
  font-size:var(--rrm-type-small)!important;
  line-height:1.25!important;
}

body.rrmModernUiP485 #panelContent,
body.rrmModernUiP485 #objectPopupBody{
  padding:8px!important;
}

body.rrmModernUiP485 #buildMenu .buildOptions{
  grid-template-columns:repeat(auto-fill, minmax(148px, 168px))!important;
  gap:6px!important;
}

body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard,
body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem{
  height:92px!important;
  min-height:92px!important;
  padding:6px!important;
  gap:4px!important;
  border-radius:10px!important;
}

body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon{
  width:34px!important;
  height:34px!important;
  flex-basis:34px!important;
}

body.rrmModernUiP485 #buildMenu .rrmBuildLabel{
  font-size:var(--rrm-type-label)!important;
  line-height:1.05!important;
}

body.rrmModernUiP485 #buildMenu .rrmBuildCost{
  font-size:var(--rrm-type-tiny)!important;
  line-height:1.05!important;
}

@media (max-width:860px), (pointer:coarse){
  :root{
    --rrm-topbar-height:38px;
    --rrm-bottombar-height:56px;
    --rrm-type-popup-title:16px;
    --rrm-type-hud:11px;
  }

  body.rrmModernUiP485 .hudTop{
    min-height:38px!important;
    padding:4px!important;
    gap:3px!important;
    border-radius:10px!important;
  }

  body.rrmModernUiP485 .hudTop .iconPill{
    height:30px!important;
    min-height:30px!important;
    padding:4px 5px!important;
    gap:3px!important;
    font-size:var(--rrm-type-hud)!important;
  }

  body.rrmModernUiP485 .hudTop .iconPill .ico,
  body.rrmModernUiP485 .hudTop .rrmHudPngIcon{
    width:17px!important;
    height:17px!important;
    min-width:17px!important;
  }

  body.rrmModernUiP485 .widePill{
    min-width:116px!important;
    max-width:156px!important;
  }

  body.rrmModernUiP485 .hudTop .iconOnly,
  body.rrmModernUiP485 .hudTop #saveBtn,
  body.rrmModernUiP485 .hudTop #infoBtn,
  body.rrmModernUiP485 .hudTop #zoomIn,
  body.rrmModernUiP485 .hudTop #zoomOut,
  body.rrmModernUiP485 .hudTop #pauseBtn{
    width:28px!important;
    height:30px!important;
    min-width:28px!important;
    min-height:30px!important;
    max-width:28px!important;
    max-height:30px!important;
    flex:0 0 28px!important;
    font-size:11px!important;
  }

  body.rrmModernUiP485 #speedBtn{
    min-width:44px!important;
    height:30px!important;
    min-height:30px!important;
    padding:0 5px!important;
    font-size:10px!important;
  }

  body.rrmModernUiP485 .hudBottom{
    min-height:50px!important;
    max-height:56px!important;
    padding:5px!important;
    gap:5px!important;
    border-radius:12px!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons{
    display:flex!important;
    grid-template-columns:none!important;
    flex-wrap:nowrap!important;
    justify-content:flex-start!important;
    align-items:center!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:5px!important;
    max-width:none!important;
    width:100%!important;
  }

  body.rrmModernUiP485 .hudBottom .iconOnly,
  body.rrmModernUiP485 .mobileMenuBtn{
    width:39px!important;
    height:39px!important;
    min-width:39px!important;
    min-height:39px!important;
    max-width:39px!important;
    max-height:39px!important;
    flex:0 0 39px!important;
    padding:0!important;
  }

  body.rrmModernUiP485 .hudBottom .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .mobileMenuBtn .uiSpriteIcon{
    width:24px!important;
    height:24px!important;
    flex-basis:24px!important;
  }

  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel,
  body.rrmModernUiP485 .mobileMenuBtn .rrmModernHudLabel{
    display:none!important;
  }

  body.rrmModernUiP485 .hudBottom #gameVersionLabel.gameVersionLabel{
    min-width:34px!important;
    height:22px!important;
    padding:2px 5px!important;
    font-size:9px!important;
    margin-left:2px!important;
  }

  body.rrmModernUiP485 .buildMenu,
  body.rrmModernUiP485 .panel:not(#workPanel){
    padding:8px!important;
    border-radius:12px!important;
  }

  body.rrmModernUiP485 #workPanel .wpHeader,
  body.rrmModernUiP485 .buildMenu>h3,
  body.rrmModernUiP485 .panel>h3,
  body.rrmModernUiP485 .objectPopupHeader,
  body.rrmModernUiP485 .sidePanelHeader,
  body.rrmModernUiP485 #eventAlert.rrmModernPanel > .eventAlertTitle{
    min-height:34px!important;
    margin:-8px -8px 7px -8px!important;
    padding:7px 38px 6px 10px!important;
    font-size:var(--rrm-type-popup-title)!important;
  }

  body.rrmModernUiP485 :is(.rrmPanelClose,#wpClose,#sideCloseBtn,#objectPopupClose,#stockPanelClose,#scheduleCloseBtn){
    top:4px!important;
    right:5px!important;
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    min-height:28px!important;
    flex-basis:28px!important;
  }

  body.rrmModernUiP485 .rrmBuildTabs button,
  body.rrmModernUiP485 .panelTabs button{
    min-height:30px!important;
    min-width:74px!important;
    padding:5px 7px!important;
    font-size:10px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions{
    grid-template-columns:repeat(auto-fill, minmax(148px, 1fr))!important;
    gap:5px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard,
  body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem{
    height:78px!important;
    min-height:78px!important;
    padding:5px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon{
    width:28px!important;
    height:28px!important;
    flex-basis:28px!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildLabel{
    font-size:10px!important;
  }

  body.rrmModernUiP485 #buildMenu .rrmBuildCost{
    font-size:8px!important;
  }
}

/* P5.53.1 - specificity lock for the compact HUD/popup shell. */
body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
  width:54px!important;
  height:40px!important;
  min-width:54px!important;
  min-height:40px!important;
  max-width:54px!important;
  max-height:40px!important;
  flex:0 0 54px!important;
  padding:3px!important;
}


body.rrmModernUiP485 :is(#sidePanel,#objectPopup) :is(.sidePanelHeader,.objectPopupHeader),
body.rrmModernUiP485 #workPanel.rrmModernPanel .wpHeader{
  min-height:38px!important;
  margin:-10px -10px 8px -10px!important;
  padding:8px 42px 7px 12px!important;
  justify-content:flex-start!important;
  text-align:left!important;
  font-size:18px!important;
  line-height:1.05!important;
}



@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    min-height:40px!important;
    max-width:40px!important;
    max-height:40px!important;
    flex:0 0 40px!important;
    padding:0!important;
  }

  
  body.rrmModernUiP485 :is(#sidePanel,#objectPopup) :is(.sidePanelHeader,.objectPopupHeader),
  body.rrmModernUiP485 #workPanel.rrmModernPanel .wpHeader{
    min-height:34px!important;
    margin:-8px -8px 7px -8px!important;
    padding:7px 36px 6px 10px!important;
    font-size:16px!important;
  }

  
}

/* ========================================================================
   P5.54 - Desktop popup and bottom HUD readability rebalance
   Restores functional size after the compact pass while keeping mobile lean.
   ======================================================================== */
:root{
  --rrm-bottombar-height:64px;
}

body.rrmModernUiP485 .hudBottom{
  min-height:64px!important;
  padding:7px!important;
  gap:8px!important;
  border-radius:16px!important;
}

body.rrmModernUiP485 .hudBottom .buttons{
  gap:7px!important;
  max-width:min(980px, calc(100vw - 36px))!important;
}

body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
  width:70px!important;
  height:52px!important;
  min-width:70px!important;
  min-height:52px!important;
  max-width:70px!important;
  max-height:52px!important;
  flex:0 0 70px!important;
  padding:5px 6px!important;
  gap:3px!important;
  border-radius:12px!important;
}

body.rrmModernUiP485 .hudBottom .buttons > .iconOnly .uiSpriteIcon,
body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn .uiSpriteIcon{
  width:27px!important;
  height:27px!important;
  flex-basis:27px!important;
}

body.rrmModernUiP485 .hudBottom .rrmModernHudLabel,
body.rrmModernUiP485 .mobileMenuBtn .rrmModernHudLabel{
  display:block!important;
  min-height:11px!important;
  font-size:10.5px!important;
  line-height:1.05!important;
}

body.rrmModernUiP485 .hudBottom #gameVersionLabel.gameVersionLabel{
  height:28px!important;
  min-width:52px!important;
  padding:4px 8px!important;
  font-size:11px!important;
}

body.rrmModernUiP485 #workPanel .wpPrioBox{
  min-width:32px!important;
  width:32px!important;
  min-height:30px!important;
  height:30px!important;
  font-size:13px!important;
  line-height:1!important;
}

@media (min-width:861px){
  body.rrmModernUiP485 #buildMenu .buildOptions{
    grid-template-columns:repeat(auto-fill, minmax(148px, 168px))!important;
    gap:8px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions > .rrmBuildCard,
  body.rrmModernUiP485 #buildMenu .buildOptions > .buildItem{
    height:106px!important;
    min-height:106px!important;
    padding:8px!important;
    gap:5px!important;
  }

  body.rrmModernUiP485 #buildMenu .buildOptions .rrmBuildCard .uiSpriteIcon{
    width:38px!important;
    height:38px!important;
    flex-basis:38px!important;
  }
}

@media (max-width:860px), (pointer:coarse){
  :root{
    --rrm-bottombar-height:66px;
  }

  body.rrmModernUiP485 .hudBottom{
    min-height:62px!important;
    max-height:70px!important;
    padding:6px!important;
    gap:6px!important;
    border-radius:14px!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons{
    gap:6px!important;
    max-width:none!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
    max-width:48px!important;
    max-height:48px!important;
    flex:0 0 48px!important;
    padding:0!important;
    gap:0!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn .uiSpriteIcon{
    width:29px!important;
    height:29px!important;
    flex-basis:29px!important;
  }

  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel,
  body.rrmModernUiP485 .mobileMenuBtn .rrmModernHudLabel{
    display:none!important;
  }

  body.rrmModernUiP485 #workPanel .wpPrioBox{
    min-width:34px!important;
    width:34px!important;
    min-height:34px!important;
    height:34px!important;
    font-size:14px!important;
  }
}

/* P5.54.2 - Work panel table sizing and full-cell click targets. */
body.rrmModernUiP485 #workPanel{
  --rrm-work-name-col:200px;
}

body.rrmModernUiP485 #workPanel .wpTableWrap{
  overflow-x:auto!important;
}

body.rrmModernUiP485 #workPanel table{
  width:100%!important;
  table-layout:fixed!important;
  min-width:690px!important;
}

body.rrmModernUiP485 #workPanel th.wpName,
body.rrmModernUiP485 #workPanel td.wpName{
  width:var(--rrm-work-name-col, 200px)!important;
  min-width:var(--rrm-work-name-col, 200px)!important;
  max-width:var(--rrm-work-name-col, 200px)!important;
  padding-left:10px!important;
  padding-right:8px!important;
}

body.rrmModernUiP485 #workPanel th:not(.wpName),
body.rrmModernUiP485 #workPanel td.wpCell{
  width:calc((100% - var(--rrm-work-name-col, 200px)) / 9)!important;
  min-width:52px!important;
  padding:4px 3px!important;
  text-align:center!important;
}

body.rrmModernUiP485 #workPanel td.wpCell{
  cursor:pointer!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}

body.rrmModernUiP485 #workPanel .wpColonistHead{
  display:grid!important;
  grid-template-columns:minmax(0, 1fr) 30px!important;
  gap:6px!important;
  align-items:center!important;
}

body.rrmModernUiP485 #workPanel .wpColonistName,
body.rrmModernUiP485 #workPanel .wpProf{
  display:block!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
overflow-wrap:anywhere;}

body.rrmModernUiP485 #workPanel .wpScheduleBtn{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  padding:0!important;
}

body.rrmModernUiP485 #workPanel .wpPrioBox{
  position:relative!important;
  z-index:2!important;
  pointer-events:auto!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
  margin:auto!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #workPanel{
    --rrm-work-name-col:180px;
  }

  body.rrmModernUiP485 #workPanel table{
    min-width:620px!important;
  }

  body.rrmModernUiP485 #workPanel th.wpName,
  body.rrmModernUiP485 #workPanel td.wpName{
    padding-left:8px!important;
    padding-right:6px!important;
  }

  body.rrmModernUiP485 #workPanel th:not(.wpName),
  body.rrmModernUiP485 #workPanel td.wpCell{
    min-width:46px!important;
    padding:4px 2px!important;
  }
}

/* P5.55 - popup consistency audit.
   Construction-family popups share one grid/card contract so long labels or
   managed control rules cannot create random button sizes. */












@media (max-width:860px), (pointer:coarse){
  

  

  

  

  
}

@media (orientation:landscape) and (max-height:520px) and (max-width:960px){
  

  

  
}

/* P10.21.4 - canonical mobile viewport popup shell.
   On mobile, popups own the viewport and render above both HUDs. */
@media (max-width:900px), (pointer:coarse){
  :root{
    --rrm-bottombar-height:52px;
    --rrm-mobile-popup-gap:6px;
  }

  body.rrmModernUiP485 .hudBottom{
    min-height:48px!important;
    max-height:54px!important;
    padding:4px!important;
    gap:4px!important;
    border-radius:13px!important;
    align-items:center!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons{
    display:flex!important;
    grid-template-columns:none!important;
    flex-wrap:nowrap!important;
    gap:5px!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons::-webkit-scrollbar{
    display:none!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
    width:82px!important;
    height:42px!important;
    min-width:82px!important;
    min-height:42px!important;
    max-width:82px!important;
    max-height:42px!important;
    flex:0 0 82px!important;
    padding:0 6px!important;
    gap:5px!important;
    border-radius:11px!important;
    flex-direction:row!important;
    justify-content:space-between!important;
    text-align:right!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn .uiSpriteIcon{
    width:20px!important;
    height:20px!important;
    flex-basis:20px!important;
  }

  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel,
  body.rrmModernUiP485 .mobileMenuBtn .rrmModernHudLabel{
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:none!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    text-align:right!important;
    font-size:8px!important;
    line-height:1!important;
  }

  body.rrmModernUiP485 .hudBottom #gameVersionLabel.gameVersionLabel{
    height:22px!important;
    min-width:42px!important;
    padding:2px 6px!important;
    margin-left:2px!important;
    font-size:10px!important;
    flex:0 0 auto!important;
  }

  /* UI-B P10.24.66: mobile fullscreen/HUD policy moved to ModalLayout.
     Legacy rrmManagedPopupOpenMobileP10214 geometry is intentionally retired. */

  body.rrmModernUiP485 :is(#objectPopupBody,#panelContent,.wpTableWrap,.panelContent,.popupBody,.popupContent,.scrollablePopup,.listBody){
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
}

@media (orientation:landscape) and (max-height:620px) and (max-width:960px){
  body.rrmModernUiP485 .hudBottom{
    min-height:44px!important;
    max-height:50px!important;
    padding:3px!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn{
    width:78px!important;
    height:38px!important;
    min-width:78px!important;
    min-height:38px!important;
    max-width:78px!important;
    max-height:38px!important;
    flex-basis:78px!important;
    flex-direction:row!important;
    justify-content:space-between!important;
    gap:4px!important;
    padding:0 5px!important;
    text-align:right!important;
  }

  body.rrmModernUiP485 .hudBottom .buttons > .iconOnly .uiSpriteIcon,
  body.rrmModernUiP485 .hudBottom .buttons > .mobileMenuBtn .uiSpriteIcon{
    width:18px!important;
    height:18px!important;
    flex-basis:18px!important;
  }
  body.rrmModernUiP485 .hudBottom .rrmModernHudLabel{display:block!important;font-size:7px!important;}
}

/* P5.57 - unified construction menu tabs. */
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"]{
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:0!important;
  padding:0!important;
  margin:0 0 10px!important;
  border:1px solid rgba(231,209,135,.34)!important;
  border-radius:10px!important;
  overflow:hidden!important;
  background:rgba(8,15,26,.60)!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button{
  flex:0 0 auto!important;
  width:max-content!important;
  min-width:max-content!important;
  max-width:none!important;
  min-height:36px!important;
  height:36px!important;
  margin:0!important;
  padding:0 8px!important;
  border:0!important;
  border-right:1px solid rgba(231,209,135,.24)!important;
  border-radius:0!important;
  background:rgba(18,30,45,.74)!important;
  color:#d8e3ed!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.05!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  box-shadow:none!important;
  overflow-wrap:normal!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button:last-child{
  border-right:0!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button.active{
  background:linear-gradient(180deg, rgba(39,85,120,.96), rgba(18,45,72,.94))!important;
  color:#fff3bd!important;
  box-shadow:inset 0 -2px 0 rgba(250,204,21,.82)!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildGrid{
  display:grid!important;
  grid-template-columns:repeat(auto-fill, minmax(148px, 1fr))!important;
  gap:8px!important;
  align-content:start!important;
  overflow-y:auto!important;
  padding-right:2px!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildCard{
  display:grid!important;
  grid-template-columns:30px minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr)!important;
  align-items:center!important;
  justify-content:stretch!important;
  width:100%!important;
  min-width:0!important;
  height:84px!important;
  min-height:84px!important;
  max-height:84px!important;
  padding:8px!important;
  gap:4px!important;
  border-radius:8px!important;
  text-align:right!important;
  touch-action:manipulation!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildCard[disabled]{
  opacity:.42!important;
  filter:saturate(.55)!important;
  cursor:not-allowed!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildIcon{
  display:grid!important;
  place-items:center!important;
  grid-column:1!important;
  grid-row:1!important;
  justify-self:start!important;
  width:30px!important;
  height:30px!important;
  flex:0 0 30px!important;
  border-radius:8px!important;
  background-color:color-mix(in srgb,var(--bd-border-soft) 34%,transparent)!important;
  color:var(--bd-title)!important;
  font-size:15px!important;
  font-weight:900!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildSprite{
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:contain!important;
  color:transparent!important;
  image-rendering:auto!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildSubmenu{
  grid-template-columns:repeat(auto-fill, minmax(148px, 1fr))!important;
}

body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildSubTitle{
  grid-column:1 / -1!important;
  color:#fff1b8!important;
  font-weight:900!important;
  font-size:13px!important;
  padding:0 2px 2px!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"]{
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs{
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs::-webkit-scrollbar{
    display:none!important;
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button{
    flex:0 0 auto!important;
    width:max-content!important;
    min-width:max-content!important;
    max-width:none!important;
    height:44px!important;
    min-height:44px!important;
    padding:0 8px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildGrid{
    grid-template-columns:repeat(auto-fill, minmax(148px, 1fr))!important;
    gap:6px!important;
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildCard{
    height:74px!important;
    min-height:74px!important;
    max-height:74px!important;
    padding:6px!important;
  }

  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildIcon{
    width:26px!important;
    height:26px!important;
    flex-basis:26px!important;
    font-size:13px!important;
  }
}

/* P10.27.15 - cinco tipos de cultivo em uma unica linha; todos os botoes com a mesma medida.
   Esta regra fica depois do contrato generico de cards para vencer a cascata
   tanto no desktop quanto em telas estreitas/coarse pointer. */
body.rrmModernUiP485 #farmPanel .panelSection{
  display:grid!important;
  grid-template-columns:repeat(5, minmax(0, 64px))!important;
  grid-auto-flow:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:clamp(4px, 2vw, 10px)!important;
  width:100%!important;
}

body.rrmModernUiP485 #farmPanel .panelSection > .rrmBuildCard.rrmFarmIconButton{
  width:100%!important;
  min-width:0!important;
  max-width:64px!important;
  height:auto!important;
  min-height:0!important;
  max-height:64px!important;
  aspect-ratio:1 / 1!important;
  padding:7px!important;
  gap:0!important;
}

body.rrmModernUiP485 #farmPanel .panelSection > .rrmFarmIconButton .uiSpriteIcon{
  width:100%!important;
  height:100%!important;
  max-width:48px!important;
  max-height:48px!important;
  flex:1 1 auto!important;
}

/* P6.4 - colonist identity actions and inspectable mood/profession details. */
body.rrmModernUiP485 .rrmColonistSummaryRow{
  align-items:stretch!important;
}

body.rrmModernUiP485 .rrmColonistHero{
  height:100%!important;
  align-items:stretch!important;
}

body.rrmModernUiP485 .rrmColonistAvatar{
  height:100%!important;
  min-height:112px!important;
}

body.rrmModernUiP485 .rrmColonistIdentity{
  min-width:0!important;
  align-self:center!important;
}

body.rrmModernUiP485 .rrmColonistNameRow{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  min-width:0!important;
  margin-bottom:7px!important;
}

body.rrmModernUiP485 .rrmColonistNameRow .rrmColonistName{
  min-width:0!important;
  margin:0!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmColonistNameRow .rrmColonistCombatToggleP67{
  position:static!important;
  inset:auto!important;
  flex:0 0 30px!important;
  margin:0!important;
  display:grid!important;
  place-items:center!important;
  padding:4px!important;
}

body.rrmModernUiP485 .rrmColonistNameRow .rrmColonistCombatToggleP67 .rrmMiniSprite{
  width:17px!important;
  height:17px!important;
}

body.rrmModernUiP485 .rrmColonistMeta{
  align-items:start!important;
}

body.rrmModernUiP485 .rrmColonistMetaButton{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:6px!important;
  width:auto!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:30px!important;
  height:auto!important;
  padding:3px 9px 3px 5px!important;
  margin:0!important;
  border:1px solid color-mix(in srgb,var(--bd-border) 38%,transparent)!important;
  border-radius:9px!important;
  background:rgba(7,16,27,.58)!important;
  color:var(--rrm-modern-muted)!important;
  font:inherit!important;
  line-height:1!important;
  text-align:left!important;
  touch-action:manipulation!important;
}

body.rrmModernUiP485 .rrmColonistMetaButton:hover,
body.rrmModernUiP485 .rrmColonistMetaButton:focus-visible{
  border-color:rgba(246,215,122,.66)!important;
  background:rgba(29,61,88,.78)!important;
  color:var(--rrm-modern-text)!important;
}

body.rrmModernUiP485 .rrmColonistMetaButton .rrmMiniSprite{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px!important;
}

body.rrmModernUiP485 .rrmColonistMetaButton > span:last-child{
  min-width:0!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmColonistCards .rrmStatusCard{grid-area:status!important;}
body.rrmModernUiP485 .rrmColonistCards .rrmColonistMoodSummary{grid-area:mood!important;}
body.rrmModernUiP485 .rrmColonistCards .rrmEquipmentCard{grid-area:equipment!important;}
body.rrmModernUiP485 .rrmColonistCards .rrmInventoryCard{grid-area:inventory!important;grid-column:auto!important;}
body.rrmModernUiP485 .rrmColonistMoodSummary{
  height:100%!important;
  align-items:stretch!important;
}
body.rrmModernUiP485 .rrmColonistMoodSummary > div{
  height:100%!important;
  box-sizing:border-box!important;
  align-content:center!important;
}
body.rrmModernUiP485 .rrmEquipmentCard,
body.rrmModernUiP485 .rrmInventoryCard{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
}
body.rrmModernUiP485 .rrmEquipmentCard .rrmEquipmentGrid,
body.rrmModernUiP485 .rrmInventoryCard .rrmInventoryGrid{
  flex:1 1 auto!important;
  min-height:0!important;
  align-items:stretch!important;
}

body.rrmModernUiP485 .rrmProfessionPopup{
}

body.rrmModernUiP485 .rrmProfessionChoice{
  grid-template-columns:28px minmax(96px,.62fr) minmax(0,1.38fr)!important;
  min-height:48px!important;
}

body.rrmModernUiP485 .rrmProfessionChoice small{
  white-space:normal!important;
  line-height:1.18!important;
  text-align:left!important;
}

body.rrmModernUiP485 .rrmMoodPopup{
}

body.rrmModernUiP485 .rrmMoodPopupBody{
  display:grid!important;
  gap:10px!important;
  min-height:0!important;
  padding:10px!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
}

body.rrmModernUiP485 .rrmMoodSummaryCards{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
}

body.rrmModernUiP485 .rrmMoodSummaryCards > div{
  display:grid!important;
  gap:3px!important;
  min-width:0!important;
  padding:8px!important;
  border:1px solid color-mix(in srgb,var(--bd-border-soft) 42%,transparent)!important;
  border-radius:9px!important;
  background:rgba(7,16,27,.64)!important;
  text-align:center!important;
}

body.rrmModernUiP485 .rrmMoodSummaryCards small{
  color:var(--rrm-modern-muted)!important;
  font-size:9px!important;
  line-height:1.08!important;
}

body.rrmModernUiP485 .rrmMoodSummaryCards strong{
  min-width:0!important;
  overflow:visible!important;
  text-overflow:clip!important;
  color:var(--rrm-modern-text)!important;
  font-size:13px!important;
overflow-wrap:anywhere;}

body.rrmModernUiP485 .rrmMoodSummaryCards .positive strong{color:var(--bd-success)!important;}
body.rrmModernUiP485 .rrmMoodSummaryCards .negative strong{color:var(--bd-danger)!important;}

body.rrmModernUiP485 .rrmMoodSection{
  display:grid!important;
  gap:6px!important;
  min-width:0!important;
  padding:9px!important;
  border:1px solid rgba(215,180,95,.20)!important;
  border-radius:11px!important;
  background:rgba(9,19,31,.52)!important;
}

body.rrmModernUiP485 .rrmMoodSection h4{
  margin:0!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:12px!important;
}

body.rrmModernUiP485 .rrmMoodFactors{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(138px,1fr))!important;
  align-items:start!important;
  gap:5px!important;
}

body.rrmModernUiP485 .rrmMoodFactor{
  display:grid!important;
  grid-template-columns:18px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:5px!important;
  min-width:0!important;
  min-height:28px!important;
  padding:4px 6px!important;
  border:1px solid color-mix(in srgb,var(--bd-border-soft) 34%,transparent)!important;
  border-radius:999px!important;
  background:rgba(5,12,21,.56)!important;
}

body.rrmModernUiP485 .rrmMoodFactorSign{
  display:grid!important;
  place-items:center!important;
  width:17px!important;
  height:17px!important;
  border-radius:50%!important;
  background:color-mix(in srgb,var(--bd-border-soft) 34%,transparent)!important;
  font-weight:950!important;
}

body.rrmModernUiP485 .rrmMoodFactor > span:nth-child(2){display:grid!important;gap:1px!important;min-width:0!important;}
body.rrmModernUiP485 .rrmMoodFactor strong{display:block!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;font-size:10px!important;overflow-wrap:anywhere;}
body.rrmModernUiP485 .rrmMoodFactor small{color:var(--rrm-modern-muted)!important;font-size:8px!important;white-space:nowrap!important;}
body.rrmModernUiP485 .rrmMoodFactor > b{font-size:10px!important;font-variant-numeric:tabular-nums!important;white-space:nowrap!important;}
body.rrmModernUiP485 .rrmMoodFactor.positive .rrmMoodFactorSign,
body.rrmModernUiP485 .rrmMoodFactor.positive > b{color:var(--bd-success)!important;}
body.rrmModernUiP485 .rrmMoodFactor.negative .rrmMoodFactorSign,
body.rrmModernUiP485 .rrmMoodFactor.negative > b{color:var(--bd-danger)!important;}

body.rrmModernUiP485 .rrmMoodDetailGrid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:5px 10px!important;
}

body.rrmModernUiP485 .rrmMoodDetailGrid > div{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:6px!important;
  min-width:0!important;
  padding:4px 0!important;
  border-bottom:1px solid rgba(255,255,255,.07)!important;
  color:var(--rrm-modern-muted)!important;
  font-size:10px!important;
}

body.rrmModernUiP485 .rrmMoodDetailGrid strong{color:var(--rrm-modern-text)!important;white-space:nowrap!important;}
body.rrmModernUiP485 .rrmMoodEmpty{padding:10px!important;color:var(--rrm-modern-muted)!important;text-align:center!important;font-size:10px!important;}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistSummaryRow{
    align-items:stretch!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistHero{
    height:100%!important;
    align-items:stretch!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistAvatar{
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
    flex:0 0 68px!important;
    height:100%!important;
    min-height:0!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistNameRow{
    gap:5px!important;
    margin-bottom:4px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistNameRow .rrmColonistCombatToggleP67{
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    min-height:26px!important;
    max-width:26px!important;
    max-height:26px!important;
    flex-basis:26px!important;
    padding:3px!important;
    border-radius:7px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistNameRow .rrmColonistCombatToggleP67 .rrmMiniSprite{
    width:18px!important;
    height:18px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMeta{
    grid-template-columns:minmax(0,1fr)!important;
    gap:3px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile #panelContent .rrmColonistMetaButton,
  body.rrmModernUiP485.rrmColonistFocusMobile #panelContent.rrmColonistContentMobileP4208 .rrmColonistMetaButton{
    width:50%!important;
    max-width:50%!important;
    min-width:0!important;
    min-height:22px!important;
    padding:2px 5px 2px 3px!important;
    gap:3px!important;
    border-radius:7px!important;
    font-size:9px!important;
    flex:0 0 auto!important;
    justify-self:start!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMetaButton .rrmMiniSprite{
    width:17px!important;
    height:17px!important;
    flex-basis:17px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile #sidePanel.sidePanel.rrmColonistOnlyPopup #panelContent{
    display:flex!important;
    flex-direction:column!important;
    min-height:0!important;
    padding-bottom:9px!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistProfile{
    flex:1 1 auto!important;
    width:100%!important;
    min-height:0!important;
    height:100%!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:7px!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistCards{
    grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)!important;
    grid-template-rows:auto minmax(72px,1fr)!important;
    grid-template-areas:
      "status mood"
      "equipment inventory"!important;
    gap:7px!important;
    min-height:0!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMoodSummary{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:4px!important;
    min-height:0!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMoodSummary > div{
    min-height:0!important;
    padding:5px 4px!important;
    border-radius:8px!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMoodSummary small{
    font-size:7.5px!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistMoodSummary strong{
    font-size:11px!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmStatusCard{
    grid-area:status!important;
    min-height:0!important;
    height:auto!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentCard{
    grid-area:equipment!important;
    min-height:0!important;
    height:100%!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryCard{
    grid-area:inventory!important;
    min-height:0!important;
    height:100%!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentGrid,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventoryGrid{
    flex:1 1 auto!important;
    min-height:0!important;
    align-items:stretch!important;
  }
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmEquipmentSlot,
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmInventorySlot{
    min-height:0!important;
    height:100%!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmProfessionChoice{
    grid-template-columns:22px minmax(82px,.55fr) minmax(0,1.45fr)!important;
    min-height:42px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmMoodSummaryCards{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmMoodPopupBody{
    gap:7px!important;
    padding:8px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmMoodSection{
    padding:7px!important;
  }

  body.rrmModernUiP485.rrmColonistFocusMobile .rrmMoodDetailGrid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:3px 8px!important;
  }
}

/* P6.5 - desktop colonist subpopups share one immutable shell. Dynamic mood
   factors and equipment availability scroll inside instead of resizing it. */
@media (min-width:861px) and (pointer:fine){
  body.rrmModernUiP485 .rrmEquipmentPopup{

  }

  body.rrmModernUiP485 .rrmEquipmentPopupChoices,
  body.rrmModernUiP485 .rrmMoodPopupBody{
    flex:1 1 auto!important;
    min-height:0!important;
  }
}


/* P6.12 — mobile equipment and mood scrolling.
   Leave a narrow gesture gutter and never consume vertical pan on option buttons. */
body.rrmModernUiP485 .rrmEquipmentPopupChoices,
body.rrmModernUiP485 .rrmMoodPopupBody{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
  touch-action:pan-y!important;
  scrollbar-gutter:stable!important;
}

body.rrmModernUiP485 .rrmEquipmentChoice{
  touch-action:pan-y!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 .rrmEquipmentPopup{
    display:flex!important;
    flex-direction:column!important;

  }
  body.rrmModernUiP485 .rrmEquipmentPopupChoices{
    width:100%!important;
    align-content:start!important;
    padding-right:14px!important;
  }
  body.rrmModernUiP485 .rrmEquipmentChoice{
    width:calc(100% - 10px)!important;
    max-width:calc(100% - 10px)!important;
    justify-self:start!important;
  }
  body.rrmModernUiP485 .rrmMoodPopupBody{
    padding-right:14px!important;
  }

  body.rrmModernUiP485 .rrmMoodFactors{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;
  }
  body.rrmModernUiP485 .rrmMoodFactor{
    min-height:26px!important;
    padding:3px 5px!important;
  }
  body.rrmModernUiP485 .rrmMoodFactor small{display:none!important;}
}


/* P6.21 — clothing and hat preference choices.
   Keep a generous gesture gutter while presenting compact, left-aligned rows. */
body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentPopupChoices,
body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentPopupChoices{
  justify-items:start!important;
  align-content:start!important;
}

body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentChoice,
body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentChoice{
  width:70%!important;
  max-width:70%!important;
  justify-self:start!important;
  grid-template-columns:24px minmax(0,1fr) 58px!important;
  text-align:center!important;
}

body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentChoice.clear,
body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentChoice.clear{
  grid-template-columns:minmax(0,1fr)!important;
  text-align:center!important;
}

body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentChoice span,
body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentChoice span,
body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentChoice small,
body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentChoice small{
  text-align:center!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 .rrmEquipmentPopup-clothes .rrmEquipmentChoice,
  body.rrmModernUiP485 .rrmEquipmentPopup-hat .rrmEquipmentChoice{
    width:70%!important;
    max-width:70%!important;
    grid-template-columns:18px minmax(0,1fr) 48px!important;
  }
}


/* P6.42.5 — popup de cadáver compacto, sem retrato e com dados em uma linha */
body.rrmModernUiP485 .rrmCorpsePopupP6425{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  min-width:0!important;
}
body.rrmModernUiP485 .rrmCorpseFactsP6425{
  display:grid!important;
  grid-template-columns:minmax(180px,1.65fr) minmax(125px,1fr) minmax(135px,1fr) minmax(64px,.48fr)!important;
  align-items:stretch!important;
  gap:7px!important;
  width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:1px 0 3px!important;
  scrollbar-width:thin;
}
body.rrmModernUiP485 .rrmCorpseFactP6425{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  min-width:0!important;
  min-height:36px!important;
  padding:6px 9px!important;
  margin:0!important;
  border:1px solid color-mix(in srgb,var(--bd-border) 35%,transparent)!important;
  border-radius:9px!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--bd-panel-alt) 92%,transparent),color-mix(in srgb,var(--bd-panel) 90%,transparent))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
  box-sizing:border-box!important;
}
body.rrmModernUiP485 .rrmCorpseFactP6425 span{
  flex:0 0 auto!important;
  color:var(--rrm-modern-muted)!important;
  font-size:11px!important;
  font-weight:800!important;
  white-space:nowrap!important;
}
body.rrmModernUiP485 .rrmCorpseFactP6425 strong{
  min-width:0!important;
  overflow:visible!important;
  text-overflow:clip!important;
  color:var(--rrm-modern-text)!important;
  font-size:12px!important;
  font-weight:850!important;
  text-align:right!important;
  white-space:normal!important;
overflow-wrap:anywhere;}
body.rrmModernUiP485 .rrmCorpseActionsP6425{
  margin-top:0!important;
  padding-top:0!important;
  gap:7px!important;
}
body.rrmModernUiP485 .rrmCorpseActionsP6425 button{
  min-width:96px!important;
}
@media (max-width:520px){
  body.rrmModernUiP485 .rrmCorpseFactsP6425{
    grid-template-columns:150px 115px 125px 58px!important;
  }
  body.rrmModernUiP485 .rrmCorpseFactP6425{
    min-height:34px!important;
    padding:5px 7px!important;
  }
}


/* P6.42.7 — mood screen easy scrolling.
   The mood inspector contains no interactive controls besides close, so every
   visible content area may initiate a vertical pan. */
body.rrmModernUiP485 .rrmMoodPopup{

}
body.rrmModernUiP485 .rrmMoodPopupBody,
body.rrmModernUiP485 .rrmMoodPopupBody *{
  touch-action:pan-y!important;
}
body.rrmModernUiP485 .rrmMoodPopup .rrmPanelClose{
  touch-action:manipulation!important;
}

/* P10.21.4 — Character Identity / edge-to-edge mobile popup + stable portrait sizing */
body.rrmModernUiP485 .rrmColonistAvatarStoryButton{
  appearance:none;
  padding:0;
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  min-width:112px!important;
  max-width:112px!important;
  color:inherit;
  font:inherit;
  cursor:pointer;
  transition:transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
body.rrmModernUiP485 .rrmColonistAvatarStoryButton:hover,
body.rrmModernUiP485 .rrmColonistAvatarStoryButton:focus-visible{
  transform:translateY(-1px);
  border-color:rgba(246,215,122,.66);
  box-shadow:0 0 0 2px rgba(246,215,122,.12), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 34%,transparent);
  outline:none;
}
body.rrmModernUiP485.rrmCharacterBiographyOpen{
  overflow:hidden!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyLayer{
  position:fixed!important;
  inset:0!important;
  z-index:var(--rrm-z-modal-secondary)!important;
  isolation:isolate!important;
  display:grid!important;
  place-items:center!important;
  padding:16px!important;
  background:rgba(2,8,15,.76)!important;
  backdrop-filter:blur(2px)!important;
  -webkit-backdrop-filter:blur(2px)!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyPopup{
  position:relative!important;
  width:min(930px, calc(100vw - 32px))!important;
  height:min(680px, calc(100dvh - 32px))!important;
  min-height:0!important;
  max-height:calc(100dvh - 32px)!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  border:1px solid rgba(215,180,95,.64)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg, rgba(8,19,32,.995), rgba(5,14,25,.995))!important;
  box-shadow:0 24px 80px rgba(0,0,0,.56), inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 22%,transparent)!important;
  color:var(--rrm-modern-text)!important;
  touch-action:pan-y!important;
  overscroll-behavior:contain!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyTitlebar{
  position:relative!important;
  flex:0 0 auto!important;
  min-height:58px!important;
  display:grid!important;
  place-items:center!important;
  padding:10px 64px!important;
  border-bottom:1px solid color-mix(in srgb,var(--bd-border) 38%,transparent)!important;
  background:linear-gradient(180deg, rgba(11,24,39,.99), rgba(7,17,29,.99))!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyTitlebar h3{
  margin:0!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:23px!important;
  line-height:1.1!important;
  font-weight:950!important;
  letter-spacing:-.02em!important;
  text-align:center!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyTitlebar .rrmPanelClose{
  position:absolute!important;
  top:8px!important;
  right:10px!important;
}
body.rrmModernUiP485 .rrmCharacterBiographyScroll{
  flex:1 1 auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  padding:14px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
  scrollbar-gutter:stable!important;
}
body.rrmModernUiP485 .rrmBiographyHero{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:96px minmax(0,1fr) minmax(230px,.72fr)!important;
  align-items:center!important;
  gap:14px!important;
  min-width:0!important;
  padding:12px!important;
  border:1px solid color-mix(in srgb,var(--bd-border) 42%,transparent)!important;
  border-radius:15px!important;
  background:linear-gradient(180deg, rgba(26,43,61,.88), rgba(18,32,48,.86))!important;
}
body.rrmModernUiP485 .rrmBiographyAvatar{
  width:96px!important;
  height:104px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border:1px solid rgba(215,180,95,.38)!important;
  border-radius:14px!important;
  background:rgba(5,14,24,.68)!important;
}
body.rrmModernUiP485 .rrmBiographyAvatar img{
  width:84px!important;
  height:96px!important;
  object-fit:contain!important;
  image-rendering:pixelated!important;
}
body.rrmModernUiP485 .rrmBiographyAvatar .rrmAvatarFallback{
  font-size:38px!important;
  font-weight:950!important;
  color:var(--rrm-modern-gold-2)!important;
}
body.rrmModernUiP485 .rrmBiographyIdentity{
  min-width:0!important;
}
body.rrmModernUiP485 .rrmBiographyIdentity h2{
  margin:0 0 5px!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
  color:var(--rrm-modern-text)!important;
  font-size:26px!important;
  line-height:1.06!important;
  font-weight:950!important;
  letter-spacing:-.025em!important;
overflow-wrap:anywhere;}
body.rrmModernUiP485 .rrmBiographyMeta{
  margin:0 0 8px!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:13px!important;
  font-weight:850!important;
}
body.rrmModernUiP485 .rrmBiographyChips{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}
body.rrmModernUiP485 .rrmBiographyChips span{
  display:inline-flex!important;
  align-items:center!important;
  min-height:27px!important;
  max-width:100%!important;
  padding:4px 9px!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
  border:1px solid rgba(215,180,95,.34)!important;
  border-radius:9px!important;
  background:rgba(5,14,24,.58)!important;
  color:var(--rrm-modern-text)!important;
  font-size:11px!important;
  font-weight:850!important;
overflow-wrap:anywhere;}
body.rrmModernUiP485 .rrmBiographyMotivation{
  align-self:stretch!important;
  min-width:0!important;
  margin:0!important;
  padding:12px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:5px!important;
  border:1px solid color-mix(in srgb,var(--bd-border) 42%,transparent)!important;
  border-radius:13px!important;
  background:rgba(5,14,24,.72)!important;
}
body.rrmModernUiP485 .rrmBiographyMotivation strong{
  color:var(--rrm-modern-muted)!important;
  font-size:10px!important;
  font-weight:950!important;
  letter-spacing:.055em!important;
  text-transform:uppercase!important;
}
body.rrmModernUiP485 .rrmBiographyMotivation span{
  color:var(--rrm-modern-text)!important;
  font-size:13px!important;
  line-height:1.42!important;
  font-style:italic!important;
}
body.rrmModernUiP485 .rrmBiographyTabs{
  flex:0 0 auto!important;
  display:flex!important;
  flex-wrap:wrap!important;
  gap:7px!important;
  min-height:38px!important;
}
body.rrmModernUiP485 .rrmBiographyTabs button{
  appearance:none!important;
  min-height:38px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  padding:6px 12px!important;
  border:1px solid rgba(215,180,95,.32)!important;
  border-radius:10px!important;
  background:rgba(12,27,43,.82)!important;
  color:var(--rrm-modern-text)!important;
  font:inherit!important;
  font-size:12px!important;
  font-weight:900!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}
body.rrmModernUiP485 .rrmBiographyTabs button:hover,
body.rrmModernUiP485 .rrmBiographyTabs button:focus-visible{
  border-color:rgba(246,215,122,.7)!important;
  outline:none!important;
}
body.rrmModernUiP485 .rrmBiographyTabs button.active{
  border-color:rgba(246,215,122,.88)!important;
  background:linear-gradient(180deg, rgba(24,115,166,.96), rgba(13,73,112,.96))!important;
  color:#fff7d8!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--bd-border-soft) 50%,transparent)!important;
}
body.rrmModernUiP485 .rrmBiographyTabs .rrmMiniSprite{
  width:18px!important;
  height:18px!important;
  flex:0 0 18px!important;
}
body.rrmModernUiP485 .rrmBiographyHistoryGrid{
  flex:1 0 auto!important;
  display:grid!important;
  grid-template-columns:minmax(0,1.12fr) minmax(285px,.88fr)!important;
  gap:12px!important;
  min-width:0!important;
  align-items:stretch!important;
}
body.rrmModernUiP485 .rrmBiographyHistoryColumn{
  min-width:0!important;
  display:grid!important;
  grid-template-rows:auto auto!important;
  gap:12px!important;
  align-content:start!important;
}
body.rrmModernUiP485 .rrmBiographyStoryPanel,
body.rrmModernUiP485 .rrmBiographyPastPanel,
body.rrmModernUiP485 .rrmBiographyChroniclePanel,
body.rrmModernUiP485 .rrmBiographyProfileView,
body.rrmModernUiP485 .rrmBiographyChronicleFull{
  touch-action:pan-y!important;
  min-width:0!important;
  padding:13px!important;
  border:1px solid rgba(215,180,95,.27)!important;
  border-radius:14px!important;
  background:linear-gradient(180deg, rgba(25,42,60,.88), rgba(15,29,44,.9))!important;
}
body.rrmModernUiP485 .rrmBiographyKicker{
  margin:0 0 4px!important;
  color:var(--rrm-modern-muted)!important;
  font-size:10px!important;
  line-height:1.2!important;
  font-weight:950!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
}
body.rrmModernUiP485 .rrmBiographyStoryPanel > h4{
  margin:0 0 7px!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:21px!important;
  line-height:1.08!important;
  font-weight:950!important;
}
body.rrmModernUiP485 .rrmBiographyProse{
  display:grid!important;
  gap:8px!important;
}
body.rrmModernUiP485 .rrmBiographyProse p{
  margin:0!important;
  color:var(--rrm-modern-text)!important;
  font-size:12.5px!important;
  line-height:1.5!important;
}
body.rrmModernUiP485 .rrmBiographySectionTitle{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  margin:0 0 9px!important;
}
body.rrmModernUiP485 .rrmBiographySectionTitle h4{
  margin:0!important;
  color:var(--rrm-modern-gold-2)!important;
  font-size:14px!important;
  font-weight:950!important;
}
body.rrmModernUiP485 .rrmBiographySectionTitle .rrmMiniSprite{
  width:20px!important;
  height:20px!important;
  flex:0 0 20px!important;
}
body.rrmModernUiP485 .rrmBiographyPastGrid,
body.rrmModernUiP485 .rrmBiographyProfileGrid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px 9px!important;
}
body.rrmModernUiP485 .rrmBiographyProfileGrid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body.rrmModernUiP485 .rrmBiographyFact{
  min-width:0!important;
  padding:8px 9px!important;
  display:grid!important;
  gap:3px!important;
  border-radius:9px!important;
  background:rgba(4,13,23,.5)!important;
}
body.rrmModernUiP485 .rrmBiographyFact span{
  color:var(--rrm-modern-muted)!important;
  font-size:9px!important;
  line-height:1.1!important;
  font-weight:950!important;
}
body.rrmModernUiP485 .rrmBiographyFact strong{
  min-width:0!important;
  color:var(--rrm-modern-text)!important;
  font-size:11px!important;
  line-height:1.3!important;
  font-weight:850!important;
  overflow-wrap:anywhere!important;
}
body.rrmModernUiP485 .rrmBiographyChroniclePanel{
  align-self:start!important;
  display:flex!important;
  flex-direction:column!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleList{
  min-height:0!important;
  display:grid!important;
  align-content:start!important;
  gap:7px!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleList.isFull{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleEvent{
  min-width:0!important;
  padding:8px 9px!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:start!important;
  gap:6px!important;
  border-left:3px solid rgba(215,180,95,.42)!important;
  border-radius:0 9px 9px 0!important;
  background:rgba(4,13,23,.52)!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleEvent.rrmImportance4,
body.rrmModernUiP485 .rrmBiographyChronicleEvent.rrmImportance5{
  border-left-color:var(--rrm-modern-gold-2)!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleEvent strong{
  color:var(--rrm-modern-gold-2)!important;
  font-size:10px!important;
  line-height:1.35!important;
  white-space:nowrap!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleEvent span{
  min-width:0!important;
  color:var(--rrm-modern-text)!important;
  font-size:10.5px!important;
  line-height:1.38!important;
}
body.rrmModernUiP485 .rrmBiographyChronicleEmpty{
  padding:13px!important;
  color:var(--rrm-modern-muted)!important;
  font-size:11px!important;
  font-style:italic!important;
  text-align:center!important;
}
body.rrmModernUiP485 .rrmBiographyProfileView,
body.rrmModernUiP485 .rrmBiographyChronicleFull{
  flex:1 0 auto!important;
}
body.rrmModernUiP485 .rrmBiographyArrivalNote{
  margin-top:12px!important;
  padding:10px 11px!important;
  border-left:3px solid var(--rrm-modern-gold-2)!important;
  border-radius:0 10px 10px 0!important;
  background:rgba(4,13,23,.48)!important;
}
body.rrmModernUiP485 .rrmBiographyArrivalNote span{
  display:block!important;
  margin-bottom:3px!important;
  color:var(--rrm-modern-muted)!important;
  font-size:9px!important;
  font-weight:950!important;
  text-transform:uppercase!important;
}
body.rrmModernUiP485 .rrmBiographyArrivalNote p{
  margin:0!important;
  color:var(--rrm-modern-text)!important;
  font-size:11px!important;
  line-height:1.42!important;
}

@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 .rrmCharacterBiographyLayer{
    padding:0!important;
  }
  body.rrmModernUiP485 .rrmCharacterBiographyPopup{
    width:100vw!important;
    height:100dvh!important;
    max-width:100vw!important;
    max-height:100dvh!important;
    border-radius:0!important;
  }
  body.rrmModernUiP485 .rrmCharacterBiographyTitlebar{
    min-height:44px!important;
    padding:7px 54px!important;
  }
  body.rrmModernUiP485 .rrmCharacterBiographyTitlebar h3{
    font-size:17px!important;
  }
  body.rrmModernUiP485 .rrmCharacterBiographyTitlebar .rrmPanelClose{
    top:5px!important;
    right:6px!important;
  }
  body.rrmModernUiP485 .rrmCharacterBiographyScroll{
    gap:8px!important;
    padding:8px 11px 8px 8px!important;
  }
  body.rrmModernUiP485 .rrmBiographyHero{
    grid-template-columns:72px minmax(0,1fr) minmax(190px,.68fr)!important;
    gap:9px!important;
    padding:8px!important;
    border-radius:11px!important;
  }
  body.rrmModernUiP485 .rrmBiographyAvatar{
    width:72px!important;
    height:74px!important;
    border-radius:10px!important;
  }
  body.rrmModernUiP485 .rrmBiographyAvatar img{
    width:64px!important;
    height:68px!important;
  }
  body.rrmModernUiP485 .rrmBiographyIdentity h2{
    font-size:18px!important;
    margin-bottom:3px!important;
  }
  body.rrmModernUiP485 .rrmBiographyMeta{
    margin-bottom:5px!important;
    font-size:10px!important;
  }
  body.rrmModernUiP485 .rrmBiographyChips span{
    min-height:22px!important;
    padding:2px 6px!important;
    font-size:9px!important;
  }
  body.rrmModernUiP485 .rrmBiographyMotivation{
    padding:8px!important;
  }
  body.rrmModernUiP485 .rrmBiographyMotivation strong{
    font-size:8px!important;
  }
  body.rrmModernUiP485 .rrmBiographyMotivation span{
    font-size:10px!important;
    line-height:1.3!important;
  }
  body.rrmModernUiP485 .rrmBiographyTabs{
    gap:5px!important;
    min-height:31px!important;
  }
  body.rrmModernUiP485 .rrmBiographyTabs button{
    min-height:31px!important;
    padding:4px 8px!important;
    border-radius:8px!important;
    font-size:10px!important;
  }
  body.rrmModernUiP485 .rrmBiographyTabs .rrmMiniSprite{
    width:15px!important;
    height:15px!important;
    flex-basis:15px!important;
  }
  body.rrmModernUiP485 .rrmBiographyHistoryGrid{
    grid-template-columns:minmax(0,1.08fr) minmax(230px,.92fr)!important;
    gap:8px!important;
  }
  body.rrmModernUiP485 .rrmBiographyHistoryColumn{
    gap:8px!important;
  }
  body.rrmModernUiP485 .rrmBiographyStoryPanel,
  body.rrmModernUiP485 .rrmBiographyPastPanel,
  body.rrmModernUiP485 .rrmBiographyChroniclePanel,
  body.rrmModernUiP485 .rrmBiographyProfileView,
  body.rrmModernUiP485 .rrmBiographyChronicleFull{
    padding:9px!important;
    border-radius:10px!important;
  }
  body.rrmModernUiP485 .rrmBiographyKicker{font-size:8px!important;}
  body.rrmModernUiP485 .rrmBiographyStoryPanel > h4{font-size:16px!important;margin-bottom:5px!important;}
  body.rrmModernUiP485 .rrmBiographyProse{gap:5px!important;}
  body.rrmModernUiP485 .rrmBiographyProse p{font-size:9.5px!important;line-height:1.38!important;}
  body.rrmModernUiP485 .rrmBiographySectionTitle{margin-bottom:6px!important;gap:5px!important;}
  body.rrmModernUiP485 .rrmBiographySectionTitle h4{font-size:11px!important;}
  body.rrmModernUiP485 .rrmBiographySectionTitle .rrmMiniSprite{width:16px!important;height:16px!important;flex-basis:16px!important;}
  body.rrmModernUiP485 .rrmBiographyPastGrid,
  body.rrmModernUiP485 .rrmBiographyProfileGrid{gap:4px 5px!important;}
  body.rrmModernUiP485 .rrmBiographyProfileGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.rrmModernUiP485 .rrmBiographyFact{padding:5px 6px!important;gap:2px!important;border-radius:7px!important;}
  body.rrmModernUiP485 .rrmBiographyFact span{font-size:7.5px!important;}
  body.rrmModernUiP485 .rrmBiographyFact strong{font-size:8.7px!important;line-height:1.2!important;}
  body.rrmModernUiP485 .rrmBiographyChronicleList{gap:4px!important;}
  body.rrmModernUiP485 .rrmBiographyChronicleList.isFull{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.rrmModernUiP485 .rrmBiographyChronicleEvent{padding:5px 6px!important;gap:4px!important;}
  body.rrmModernUiP485 .rrmBiographyChronicleEvent strong{font-size:8px!important;}
  body.rrmModernUiP485 .rrmBiographyChronicleEvent span{font-size:8.3px!important;line-height:1.25!important;}
}

@media (max-width:620px){
  body.rrmModernUiP485 .rrmBiographyHero{
    grid-template-columns:68px minmax(0,1fr)!important;
  }
  body.rrmModernUiP485 .rrmBiographyMotivation{
    grid-column:1 / -1!important;
  }
  body.rrmModernUiP485 .rrmBiographyHistoryGrid{
    grid-template-columns:1fr!important;
  }
  body.rrmModernUiP485 .rrmBiographyProfileGrid,
  body.rrmModernUiP485 .rrmBiographyPastGrid,
  body.rrmModernUiP485 .rrmBiographyChronicleList.isFull{
    grid-template-columns:1fr!important;
  }
}

/* P10.24.30 - Construction taxonomy: readable grouped navigation. */
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildCategoryIntroP102430{
  grid-column:1 / -1!important;
  display:flex!important;
  align-items:baseline!important;
  gap:10px!important;
  min-height:28px!important;
  padding:5px 8px!important;
  border:1px solid var(--rrm-modern-line-soft,rgba(148,163,184,.16))!important;
  border-radius:7px!important;
  background:var(--rrm-modern-panel-2,var(--rrm-modern-bg))!important;
  color:var(--rrm-modern-text,#e7e5df)!important;
}
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildCategoryIntroP102430 b{
  flex:0 0 auto!important;
  color:var(--bd-title,var(--rrm-modern-text))!important;
  font-size:12px!important;
}
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildCategoryIntroP102430 span{
  min-width:0!important;
  color:var(--rrm-modern-muted,#a7b0b8)!important;
  font-size:10px!important;
  line-height:1.25!important;
}
@media (min-width:861px){
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs{
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:flex-start!important;
    overflow:visible!important;
  }
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button{
    flex:0 0 auto!important;
    width:max-content!important;
    min-width:max-content!important;
    max-width:none!important;
    min-height:32px!important;
    padding:5px 8px!important;
    white-space:nowrap!important;
  }
}
@media (max-width:860px){
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildCategoryIntroP102430{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:2px!important;
  }
}

/* P10.24.65 UI-A — Research presentation migrated from runtime style injection. */
#researchPanel.rrmResearchPanelP10190{background:linear-gradient(180deg,var(--bd-panel),var(--bd-bg-secondary))!important;border:1px solid var(--bd-border)!important;border-radius:12px!important;box-shadow:0 18px 55px var(--bd-shadow-color)!important;color:var(--bd-text)!important;}
#researchPanel.rrmResearchPanelP10190[style*="display: none"],#researchPanel.rrmResearchPanelP10190[style*="display:none"]{display:none!important;}
#researchPanel.rrmResearchPanelP10190:not([style*="display: none"]):not([style*="display:none"]){display:flex!important;flex-direction:column!important;}
#researchPanel.rrmResearchPanelP10190>h3{flex:0 0 auto!important;min-height:42px!important;margin:0!important;padding:10px 44px 9px 14px!important;border-bottom:1px solid color-mix(in srgb,var(--bd-border) 40%,transparent)!important;background:linear-gradient(180deg,var(--bd-panel-alt),var(--bd-panel))!important;color:var(--bd-title)!important;font-size:18px!important;letter-spacing:.02em!important;}
#researchPanel.rrmResearchPanelP10190>h3 .rrmPanelClose{top:6px!important;right:7px!important;}
#researchList.rrmResearchTreeListP10190{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;max-height:none!important;padding:0!important;background:transparent!important;}
.rrmTechShellP10190{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;}
.rrmTechSummaryP10190,.rrmTechSummaryChipsP10190{display:none!important}
.rrmTechMainP10190{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,28%);overflow:hidden}.rrmTechTreePaneP10190{min-width:0;min-height:0;overflow:hidden;border-right:1px solid color-mix(in srgb,var(--bd-border) 32%,transparent)}
.rrmTechTreeScrollerP10190{width:100%;height:100%;overflow-x:auto!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y!important;scrollbar-gutter:stable both-edges;background:linear-gradient(color-mix(in srgb,var(--bd-border-soft) 12%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--bd-border-soft) 10%,transparent) 1px,transparent 1px);background-size:100% 72px,140px 100%}
.rrmTechTreeCanvasP10190{position:relative;width:max-content;min-width:max(1120px,100%);padding:8px 12px 18px 0;box-sizing:border-box}.rrmTechLinksP10190{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:visible}.rrmTechLinksP10190 path{fill:none;stroke:var(--bd-border-soft);stroke-width:1.5}.rrmTechLinksP10190 path.done{stroke:var(--bd-accent)}.rrmTechLinksP10190 path.same-tier{stroke-dasharray:2 2;stroke-width:1.25}
.rrmTechTierRowP10190{position:relative;z-index:1;display:grid;grid-template-columns:58px 1110px;min-height:72px;border-bottom:1px solid color-mix(in srgb,var(--bd-border-soft) 22%,transparent)}.rrmTechTierBadgeP10190{position:sticky;left:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;margin:4px 5px 4px 4px;border:1px solid color-mix(in srgb,var(--bd-border) 40%,transparent);border-radius:7px;background:var(--bd-panel);box-shadow:8px 0 12px var(--bd-shadow-color)}.rrmTechTierBadgeP10190 b{font-size:15px;color:var(--bd-title)}.rrmTechTierBadgeP10190 small{font-size:6px;max-width:50px;text-align:center;opacity:.66;letter-spacing:.04em}
.rrmTechTierNodesP10190{display:grid;grid-template-columns:150px 130px 105px 265px 220px 90px 150px;align-items:center;column-gap:0;padding:8px 8px;min-width:1110px}.rrmTechBranchLaneP10192{min-width:0;min-height:54px;display:flex;align-items:center;justify-content:flex-start;gap:7px;padding:0 7px;box-sizing:border-box;border-left:1px solid rgba(148,163,184,.055)}.rrmTechBranchLaneP10192:first-child{border-left:0}.rrmTechBranchLaneP10192.branch-agriculture{background:linear-gradient(90deg,rgba(87,113,35,.055),transparent)}.rrmTechBranchLaneP10192.branch-commerce{background:linear-gradient(90deg,rgba(185,137,44,.045),transparent)}.rrmTechBranchLaneP10192.branch-animals{background:linear-gradient(90deg,rgba(125,78,147,.045),transparent)}.rrmTechBranchLaneP10192.branch-production{background:linear-gradient(90deg,rgba(48,111,148,.045),transparent)}.rrmTechBranchLaneP10192.branch-combat{background:linear-gradient(90deg,rgba(148,65,44,.045),transparent)}.rrmTechBranchLaneP10192.branch-world{background:linear-gradient(90deg,rgba(57,126,119,.04),transparent)}.rrmTechBranchLaneP10192.branch-electricity{background:linear-gradient(90deg,rgba(190,153,48,.05),transparent)}.rrmTechNodeP10190{position:relative;z-index:2;display:flex!important;align-items:center!important;justify-content:center!important;width:58px!important;min-width:58px!important;height:52px!important;min-height:52px!important;padding:5px!important;margin:0!important;border:1px solid var(--bd-border-soft)!important;border-radius:10px!important;background:linear-gradient(180deg,var(--bd-surface),var(--bd-panel-alt))!important;color:var(--bd-text)!important;box-shadow:0 2px 7px var(--bd-shadow-color)!important;touch-action:manipulation!important;overflow:visible!important}.rrmTechNodeP10190:hover,.rrmTechNodeP10190.inspected{filter:brightness(1.12);box-shadow:0 0 0 2px var(--bd-focus),0 4px 11px var(--bd-shadow-color)!important}.rrmTechNodeP10190.available{border-color:var(--bd-success)!important}.rrmTechNodeP10190.available .rrmTechNodeIconP10190,.rrmTechNodeP10190.researching .rrmTechNodeIconP10190,.rrmTechNodeP10190.queued .rrmTechNodeIconP10190,.rrmTechNodeP10190.done .rrmTechNodeIconP10190{filter:none!important;opacity:1!important}.rrmTechNodeP10190.researching{border-color:var(--bd-warning)!important;box-shadow:0 0 0 1px color-mix(in srgb,var(--bd-warning) 38%,transparent),0 3px 10px rgba(0,0,0,.32)!important}.rrmTechNodeP10190.queued{border-color:var(--bd-info)!important}.rrmTechNodeP10190.done{border-color:var(--bd-success)!important}.rrmTechNodeP10190.locked{border-color:var(--bd-text-disabled)!important;background:linear-gradient(180deg,var(--bd-surface),var(--bd-panel))!important}.rrmTechNodeP10190.locked .rrmTechNodeIconP10190{filter:grayscale(1) saturate(0)!important;opacity:.34!important}
.rrmTechNodeIconP10190{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.rrmTechNodeIconP10190 img{display:block;max-width:38px;max-height:38px;object-fit:contain;image-rendering:auto}.rrmTechNodeIconTextP10190{font-size:28px;line-height:1}.rrmTechNodeCopyP10190,.rrmTechLockP10190{display:none!important}.rrmTechDoneP10190{position:absolute;top:-5px;right:-5px;display:flex;align-items:center;justify-content:center;width:17px;height:17px;border-radius:999px;border:2px solid var(--bd-panel);background:var(--bd-success);color:var(--bd-selection-text);font-size:10px;font-weight:900;box-shadow:0 1px 5px var(--bd-shadow-color)}
.rrmTechDetailP10190{min-width:0;min-height:0;overflow-y:auto;padding:12px;background:linear-gradient(180deg,var(--bd-panel-alt),var(--bd-panel));box-sizing:border-box}.rrmTechDetailHeadingP10190{display:flex;align-items:center;gap:10px;padding-bottom:9px;border-bottom:1px solid color-mix(in srgb,var(--bd-border) 36%,transparent)}.rrmTechDetailHeadingP10190 .rrmTechNodeIconP10190{width:42px;height:42px}.rrmTechDetailHeadingP10190 .rrmTechNodeIconP10190 img{max-width:40px;max-height:40px}.rrmTechDetailHeadingP10190 small{font-size:8px;opacity:.58}.rrmTechDetailHeadingP10190 h4{margin:2px 0 0;font-size:14px;color:var(--bd-title)}.rrmTechDetailDescP10190{font-size:10px;line-height:1.35;color:var(--bd-text-muted);margin:10px 0}.rrmTechDetailMetaP10190{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:8px 0}.rrmTechDetailMetaP10190 div{display:flex;flex-direction:column;padding:7px;border:1px solid color-mix(in srgb,var(--bd-border-soft) 34%,transparent);border-radius:7px;background:color-mix(in srgb,var(--bd-surface) 58%,transparent)}.rrmTechDetailMetaP10190 span{font-size:7px;opacity:.6}.rrmTechDetailMetaP10190 b{font-size:11px}.rrmTechDetailP10190 section{margin-top:10px}.rrmTechDetailP10190 section>b{display:block;font-size:9px;color:var(--bd-title);margin-bottom:5px}.rrmTechReqListP10190{display:flex;flex-direction:column;gap:4px}.rrmTechReqListP10190 span{font-size:9px;padding:4px 6px;border-radius:5px;background:color-mix(in srgb,var(--bd-surface) 58%,transparent)}.rrmTechReqListP10190 .ok{color:#a8d69b}.rrmTechReqListP10190 .missing{color:#e8a98b}.rrmTechDetailP10190 ul{margin:3px 0 0;padding-left:16px}.rrmTechDetailP10190 li{font-size:9px;line-height:1.35;margin:2px 0}.rrmTechDetailActionsP10190{display:grid;grid-template-columns:1fr;gap:5px;margin-top:12px}.rrmTechDetailActionsP10190 button{width:100%!important;min-height:32px!important;padding:7px 8px!important;border-radius:7px!important;font-size:10px!important;touch-action:manipulation!important}.rrmTechDetailStateP10190{padding:8px;border:1px solid rgba(75,155,92,.38);border-radius:7px;color:#b8dfb3;background:rgba(45,104,58,.15);font-size:10px;text-align:center}.rrmTechProgressP10190{height:4px;border-radius:4px;background:rgba(255,255,255,.08);overflow:hidden;margin-top:8px}.rrmTechProgressP10190 span{display:block;height:100%;background:#d8aa31}.rrmTechEmptyP10190{font-size:10px;opacity:.6}.rrmTechQueueP10190{flex:0 0 auto;display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px;padding:5px 10px;border-top:1px solid rgba(148,163,184,.12);font-size:8px;background:rgba(3,12,22,.5)}.rrmTechQueueP10190 b{overflow:visible;text-overflow:clip;white-space:normal;font-weight:600;overflow-wrap:anywhere;}
@media(min-width:901px){#researchPanel.rrmResearchPanelP10190{top:7vh!important;max-height:84vh!important;}}
@media(max-width:900px){#researchPanel.rrmResearchPanelP10190{top:5px!important;max-height:none!important;border-radius:9px!important}#researchPanel.rrmResearchPanelP10190>h3{min-height:34px!important;padding:7px 38px 6px 10px!important;font-size:14px!important}.rrmTechMainP10190{grid-template-columns:minmax(0,1fr) minmax(170px,31%)}.rrmTechTreeCanvasP10190{width:max-content;min-width:1120px;padding-bottom:8px}.rrmTechTierRowP10190{grid-template-columns:46px 1110px;min-height:59px}.rrmTechTierBadgeP10190{margin:2px 4px 2px 2px}.rrmTechTierBadgeP10190 b{font-size:12px}.rrmTechTierBadgeP10190 small{font-size:5px;max-width:42px}.rrmTechTierNodesP10190{grid-template-columns:150px 130px 105px 265px 220px 90px 150px;min-width:1110px;column-gap:0;padding:5px 4px}.rrmTechBranchLaneP10192{min-height:44px;gap:5px;padding:0 5px}.rrmTechNodeP10190{width:46px!important;min-width:46px!important;height:42px!important;min-height:42px!important;padding:4px!important;border-radius:8px!important}.rrmTechNodeIconP10190{width:32px;height:32px}.rrmTechNodeIconP10190 img{max-width:31px;max-height:31px}.rrmTechNodeIconTextP10190{font-size:23px}.rrmTechDoneP10190{width:14px;height:14px;top:-4px;right:-4px;font-size:8px}.rrmTechDetailP10190{padding:8px}.rrmTechDetailHeadingP10190{gap:6px;padding-bottom:6px}.rrmTechDetailHeadingP10190 .rrmTechNodeIconP10190{width:32px;height:32px}.rrmTechDetailHeadingP10190 .rrmTechNodeIconP10190 img{max-width:31px;max-height:31px}.rrmTechDetailHeadingP10190 h4{font-size:11px}.rrmTechDetailDescP10190{font-size:8px;margin:6px 0}.rrmTechDetailMetaP10190{gap:4px;margin:5px 0}.rrmTechDetailMetaP10190 div{padding:5px}.rrmTechDetailMetaP10190 span{font-size:6px}.rrmTechDetailMetaP10190 b{font-size:9px}.rrmTechDetailP10190 section{margin-top:6px}.rrmTechDetailP10190 section>b,.rrmTechReqListP10190 span,.rrmTechDetailP10190 li{font-size:7px}.rrmTechDetailActionsP10190{gap:3px;margin-top:7px}.rrmTechDetailActionsP10190 button{min-height:var(--rrm-touch-target)!important;padding:4px!important;font-size:8px!important}}
@media(max-width:520px),(orientation:portrait) and (max-width:900px){.rrmTechMainP10190{display:flex;flex-direction:column}.rrmTechTreePaneP10190{flex:1 1 62%;min-height:0;border-right:0;border-bottom:1px solid rgba(218,174,63,.2)}.rrmTechDetailP10190{flex:0 0 38%;min-height:120px}.rrmTechDetailHeadingP10190 h4{font-size:10px}.rrmTechDetailDescP10190{display:none}.rrmTechDetailMetaP10190{display:none}.rrmTechDetailP10190 section{display:inline-block;vertical-align:top;width:48%;margin-right:1%}.rrmTechDetailActionsP10190{position:sticky;bottom:0;background:var(--bd-panel);padding-top:4px}}

/* P10.24.30 - Named, function-oriented research tracks. */
.rrmTechTreeCanvasP10190{min-width:max(var(--rrm-tech-tree-width,1790px),100%)!important}
.rrmTechTierRowP10190{grid-template-columns:58px var(--rrm-tech-tree-width,1790px)!important;min-height:84px}
.rrmTechTierNodesP10190,.rrmTechBranchHeaderGridP102430{grid-template-columns:var(--rrm-tech-branch-columns)!important;min-width:var(--rrm-tech-tree-width,1790px)!important}
.rrmTechBranchHeaderP102430{position:sticky;top:0;z-index:8;display:grid;grid-template-columns:58px var(--rrm-tech-tree-width,1790px);min-height:38px;border-bottom:1px solid color-mix(in srgb,var(--bd-border) 40%,transparent);background:var(--bd-panel);box-shadow:0 5px 12px var(--bd-shadow-color)}
.rrmTechBranchHeaderLeadP102430{position:sticky;left:0;z-index:10;display:flex;align-items:center;justify-content:center;border-right:1px solid var(--bd-border-soft);background:var(--bd-panel-alt);color:var(--bd-text-muted);font-size:6px;letter-spacing:.1em}
.rrmTechBranchHeaderGridP102430{display:grid}
.rrmTechBranchHeaderGridP102430>div{display:flex;flex-direction:column;justify-content:center;min-width:0;padding:4px 8px;border-left:1px solid var(--bd-border-soft);box-sizing:border-box}
.rrmTechBranchHeaderGridP102430 b{color:var(--bd-title);font-size:10px;line-height:1.1}
.rrmTechBranchHeaderGridP102430 small{margin-top:2px;color:var(--bd-text-muted);font-size:7px;line-height:1.1}
.rrmTechBranchLaneP10192{flex-wrap:wrap;align-content:center;row-gap:5px}
.rrmTechBranchLaneP10192.branch-subsistence,.rrmTechBranchHeaderGridP102430 .branch-subsistence{background:linear-gradient(90deg,rgba(87,113,35,.075),transparent)}
.rrmTechBranchLaneP10192.branch-colony,.rrmTechBranchHeaderGridP102430 .branch-colony{background:linear-gradient(90deg,rgba(185,137,44,.060),transparent)}
.rrmTechBranchLaneP10192.branch-industry,.rrmTechBranchHeaderGridP102430 .branch-industry{background:linear-gradient(90deg,rgba(48,111,148,.065),transparent)}
.rrmTechBranchHeaderGridP102430 .branch-combat{background:linear-gradient(90deg,rgba(148,65,44,.060),transparent)}
.rrmTechBranchHeaderGridP102430 .branch-world{background:linear-gradient(90deg,rgba(57,126,119,.055),transparent)}
.rrmTechBranchHeaderGridP102430 .branch-electricity{background:linear-gradient(90deg,rgba(190,153,48,.070),transparent)}
.rrmTechNodeP10190{width:98px!important;min-width:98px!important;height:66px!important;min-height:66px!important;flex-direction:row!important;justify-content:space-between!important;gap:4px!important;padding:4px 5px!important;text-align:right!important}
.rrmTechNodeIconP10190{width:34px!important;height:34px!important;flex:0 0 34px!important}
.rrmTechNodeIconP10190 img{max-width:33px!important;max-height:33px!important}
.rrmTechNodeIconTextP10190{font-size:24px!important}
.rrmTechNodeNameP102430{display:-webkit-box;flex:1 1 auto;min-width:0;max-width:55px;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--bd-text);font-size:7.5px;font-weight:700;line-height:1.08;text-align:right}
.rrmTechNodeP10190.locked .rrmTechNodeNameP102430{color:var(--bd-text-disabled)}
@media(max-width:900px){
  .rrmTechTierRowP10190{grid-template-columns:46px var(--rrm-tech-tree-width,1790px)!important}
  .rrmTechBranchHeaderP102430{grid-template-columns:46px var(--rrm-tech-tree-width,1790px)}
  .rrmTechNodeP10190{width:86px!important;min-width:86px!important;height:56px!important;min-height:56px!important;padding:3px!important}
  .rrmTechNodeIconP10190{width:28px!important;height:28px!important;flex-basis:28px!important}
  .rrmTechNodeIconP10190 img{max-width:27px!important;max-height:27px!important}
  .rrmTechNodeNameP102430{max-width:46px;font-size:6.5px;text-align:right}
  .rrmTechBranchHeaderGridP102430 b{font-size:9px}.rrmTechBranchHeaderGridP102430 small{font-size:6px}
}

/* P10.24.65 UI-A — Premium Trade presentation migrated from runtime style injection. */
#objectPopup.rrmPremiumTradePopupP628{border-color:var(--bd-border)!important;box-shadow:0 18px 60px var(--bd-shadow-color),inset 0 0 0 1px color-mix(in srgb,var(--bd-focus) 22%,transparent)!important}#objectPopupBody.rrmPremiumTradeBodyP628{padding:10px!important;background:linear-gradient(180deg,var(--bd-panel-alt),var(--bd-panel))}.rrmPremiumTradeP628{display:grid!important;gap:10px;color:var(--bd-text);min-width:0;width:100%;max-width:100%}.rrmTradeMainP628{display:grid!important;grid-template-columns:minmax(0,1fr) 180px minmax(0,1fr)!important;grid-template-areas:"colony merchant caravan";gap:10px;align-items:stretch;min-width:0;width:100%;max-width:100%;min-height:0}.rrmTradeMainP628>.rrmTradeSideP628:first-child{grid-area:colony}.rrmTradeMerchantP628{grid-area:merchant}.rrmTradeMainP628>.rrmTradeSideP628:last-child{grid-area:caravan}.rrmTradeSideP628{min-width:0;border:1px solid var(--bd-border-soft);border-radius:14px;background:linear-gradient(180deg,var(--bd-panel-alt),var(--bd-panel));padding:10px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;box-shadow:inset 0 0 24px color-mix(in srgb,var(--bd-shadow-color) 45%,transparent)}.rrmTradeSideP628 header{display:flex;align-items:center;gap:9px;padding:2px 4px 9px;border-bottom:1px solid var(--bd-border-soft)}.rrmTradeSideP628 header>span{font-size:28px}.rrmTradeSideP628 header b{display:block;font-size:18px;color:var(--bd-title)}.rrmTradeSideP628 header small{font-size:10px;opacity:.72}.rrmTradeListP628{display:grid;gap:6px;align-content:start;padding:8px 2px 6px;scrollbar-width:thin}.rrmTradeItemP628{display:grid;grid-template-columns:38px minmax(100px,1fr) 32px 28px 32px 72px;align-items:center;gap:5px;padding:7px;border:1px solid color-mix(in srgb,var(--bd-border-soft) 44%,transparent);border-radius:9px;background:var(--bd-surface)}.rrmTradeItemIconP628{width:36px;height:36px;display:grid;place-items:center}.rrmTradeItemIconP628 img{max-width:34px;max-height:34px;image-rendering:pixelated}.rrmTradeItemNameP628{min-width:0}.rrmTradeItemNameP628 b,.rrmTradeItemNameP628 small{display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}.rrmTradeItemNameP628 b{font-size:12px}.rrmTradeItemNameP628 small{font-size:8px;opacity:.67}.rrmTradeItemP628>button{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;padding:0!important;border-radius:8px!important;font-size:18px!important}.rrmTradeItemP628>strong{text-align:center;min-width:3ch;font-variant-numeric:tabular-nums}.rrmTradeLineValueP628{text-align:right;color:var(--bd-title);font-weight:800;font-size:11px;white-space:nowrap}.rrmTradeItemP628{grid-template-columns:36px minmax(100px,1fr) minmax(150px,auto) 72px!important}.rrmTradeItemP628>.bdQuantitySelector{justify-self:end}.rrmTradeDemandP102444{display:grid;gap:2px;width:100%;margin:5px 0;padding:5px;border:1px solid color-mix(in srgb,var(--bd-border-soft) 48%,transparent);border-radius:7px}.rrmTradeDemandP102444 small{display:block;font-size:8px}.rrmTradeSideP628 footer{display:flex;justify-content:space-between;align-items:center;padding:9px 5px 2px;border-top:1px solid color-mix(in srgb,var(--bd-border-soft) 48%,transparent);color:var(--bd-title)}.rrmTradeEmptyP628{padding:22px 10px;text-align:center;opacity:.7}.rrmTradeMerchantP628{display:flex;flex-direction:column;align-items:center;text-align:center;padding:5px 3px;min-width:0}.rrmTradePortraitFrameP628{position:relative!important;inset:auto!important;width:150px!important;height:150px!important;min-width:150px!important;min-height:150px!important;max-width:150px!important;max-height:150px!important;display:grid;place-items:center;overflow:hidden;border-radius:50%;flex:0 0 150px}.rrmTradePortraitFrameP628 canvas{position:static!important;inset:auto!important;display:block!important;width:144px!important;height:144px!important;min-width:144px!important;min-height:144px!important;max-width:144px!important;max-height:144px!important;margin:0!important;border-radius:50%;background:transparent!important;object-fit:contain;flex:none!important}.rrmTradeMerchantNameP628{font-size:18px;color:var(--bd-title);margin-top:5px}.rrmTradeMerchantP628>small{font-size:10px;opacity:.72}.rrmTradeSpeechP628{position:relative;margin:12px 0 8px;width:100%;min-height:60px;display:grid;place-items:center;padding:10px;border:1px solid var(--bd-border-soft);border-radius:12px;background:var(--bd-panel-alt);font-size:12px;line-height:1.25}.rrmTradeSpeechP628:after{content:"";position:absolute;bottom:-9px;left:50%;width:16px;height:16px;background:var(--bd-panel-alt);border-right:1px solid var(--bd-border-soft);border-bottom:1px solid var(--bd-border-soft);transform:translateX(-50%) rotate(45deg)}.rrmTradeScaleP628{font-size:54px;line-height:1;margin:5px}.rrmTradeWalletP628{display:grid;width:100%;gap:4px;font-size:9px}.rrmTradeWalletP628 span{display:flex;justify-content:space-between;padding:5px 7px;border-radius:7px;background:var(--bd-surface)}.rrmTradeSummaryP628{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;padding:11px;border:1px solid var(--bd-border-soft);border-radius:12px;background:var(--bd-panel-alt)}.rrmTradeSummaryP628>div{text-align:center}.rrmTradeSummaryP628 small,.rrmTradeSummaryP628 b,.rrmTradeSummaryP628 strong{display:block}.rrmTradeSummaryP628 small{color:var(--bd-title)}.rrmTradeSummaryP628 b{font-size:20px}.rrmTradeSummaryP628 .positive{color:var(--bd-success);font-size:18px}.rrmTradeSummaryP628 .negative{color:var(--bd-danger);font-size:18px}.rrmTradeSummaryP628 .neutral{color:var(--bd-title);font-size:18px}.rrmTradeTipP628{text-align:center;padding:7px;border-bottom:1px solid var(--bd-border-soft);color:var(--bd-text-muted);font-size:10px}.rrmTradeMessageP628{text-align:center;min-height:20px;font-size:10px;color:var(--bd-success)}.rrmTradeMessageP628.error{color:var(--bd-danger)}.rrmTradeActionsP628{display:flex;justify-content:center;gap:8px}.rrmTradeActionsP628 button{min-width:150px}.rrmTradeActionsP628 .confirm{min-width:260px!important;background:linear-gradient(180deg,var(--bd-selection),var(--bd-accent))!important;color:var(--bd-selection-text)!important;font-size:17px!important;font-weight:900!important;border-color:var(--bd-focus)!important}.rrmTradeActionsP628 .confirm:disabled{filter:grayscale(.7);opacity:.48}.rrmTradeActionsP628 .secondary{font-size:10px!important}@media(max-width:1000px) and (min-width:621px){#objectPopup.rrmPremiumTradePopupP628{}#objectPopupBody.rrmPremiumTradeBodyP628{padding:6px!important}.rrmPremiumTradeP628{gap:6px!important}.rrmTradeMainP628{grid-template-columns:minmax(0,1fr) 136px minmax(0,1fr)!important;grid-template-areas:"colony merchant caravan"!important;gap:6px!important}.rrmTradeSideP628{padding:6px!important;border-radius:10px!important}.rrmTradeSideP628 header{gap:5px!important;padding:1px 2px 6px!important}.rrmTradeSideP628 header>span{font-size:21px!important}.rrmTradeSideP628 header b{font-size:13px!important}.rrmTradeSideP628 header small{font-size:7px!important}.rrmTradeListP628{padding:5px 1px 4px!important;gap:4px!important}.rrmTradeItemP628{grid-template-columns:28px minmax(48px,1fr) 26px 20px 26px 48px!important;gap:3px!important;padding:5px 4px!important;border-radius:7px!important}.rrmTradeItemIconP628{width:27px!important;height:27px!important}.rrmTradeItemIconP628 img{max-width:26px!important;max-height:26px!important}.rrmTradeItemNameP628 b{font-size:10px!important}.rrmTradeItemNameP628 small{font-size:7px!important}.rrmTradeItemP628>button{width:26px!important;min-width:26px!important;height:28px!important;min-height:28px!important;font-size:15px!important;border-radius:7px!important}.rrmTradeItemP628>strong{font-size:10px!important}.rrmTradeLineValueP628{font-size:9px!important}.rrmTradeSideP628 footer{padding:6px 2px 1px!important;font-size:9px!important}.rrmTradeMerchantP628{display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;padding:3px 1px!important;min-width:0!important}.rrmTradePortraitFrameP628{width:106px!important;height:106px!important;min-width:106px!important;min-height:106px!important;max-width:106px!important;max-height:106px!important;flex-basis:106px!important}.rrmTradePortraitFrameP628 canvas{width:100px!important;height:100px!important;min-width:100px!important;min-height:100px!important;max-width:100px!important;max-height:100px!important}.rrmTradeMerchantNameP628{font-size:13px!important;margin-top:3px!important}.rrmTradeMerchantP628>small{font-size:7px!important}.rrmTradeSpeechP628{margin:6px 0 4px!important;min-height:42px!important;padding:6px!important;font-size:9px!important;border-radius:8px!important}.rrmTradeSpeechP628:after{width:11px!important;height:11px!important;bottom:-6px!important}.rrmTradeScaleP628{font-size:36px!important;margin:3px!important}.rrmTradeWalletP628{gap:3px!important;font-size:7px!important}.rrmTradeWalletP628 span{padding:4px!important}.rrmTradeSummaryP628{grid-template-columns:1fr 1fr 1fr!important;gap:5px!important;padding:7px!important}.rrmTradeSummaryP628 b{font-size:15px!important}.rrmTradeSummaryP628 .positive,.rrmTradeSummaryP628 .negative,.rrmTradeSummaryP628 .neutral{font-size:13px!important}.rrmTradeTipP628{padding:4px!important;font-size:8px!important}.rrmTradeActionsP628{gap:5px!important}.rrmTradeActionsP628 button{min-width:110px!important}.rrmTradeActionsP628 .confirm{min-width:210px!important;font-size:14px!important}}@media(max-width:620px){#objectPopupBody.rrmPremiumTradeBodyP628{}.rrmTradeMainP628{grid-template-columns:1fr!important;grid-template-areas:"merchant" "colony" "caravan"!important}.rrmTradeMerchantP628{grid-area:merchant!important;display:grid!important;grid-template-columns:112px minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;gap:4px 8px!important;text-align:left!important;align-items:center!important}.rrmTradePortraitFrameP628{grid-row:1/4!important;width:106px!important;height:106px!important;min-width:106px!important;min-height:106px!important;max-width:106px!important;max-height:106px!important;flex-basis:106px!important}.rrmTradePortraitFrameP628 canvas{width:100px!important;height:100px!important;min-width:100px!important;min-height:100px!important;max-width:100px!important;max-height:100px!important}.rrmTradeSpeechP628{margin:3px 0!important;min-height:44px!important}.rrmTradeScaleP628{display:none!important}.rrmTradeWalletP628{grid-column:2!important}.rrmTradeListP628{}.rrmTradeItemP628{grid-template-columns:30px minmax(58px,1fr) 28px 22px 28px 52px!important;gap:3px!important;padding:5px!important}.rrmTradeItemP628>button{width:28px!important;min-width:28px!important;height:30px!important;min-height:30px!important}.rrmTradeSummaryP628{grid-template-columns:1fr!important}.rrmTradeActionsP628{display:grid!important;grid-template-columns:1fr 1fr!important}.rrmTradeActionsP628 .confirm{grid-column:1/-1!important;width:100%!important;min-width:0!important}.rrmTradeActionsP628 button{min-width:0!important;width:100%!important}}
.rrmTradeItemP628{grid-template-columns:36px minmax(90px,1fr) minmax(140px,auto) 70px!important}.rrmTradeItemP628>.bdQuantitySelector{justify-self:end}@media(max-width:620px){.rrmTradeItemP628{grid-template-columns:30px minmax(70px,1fr) minmax(132px,auto) 54px!important}.rrmTradeItemP628>.bdQuantitySelector{max-width:100%}.rrmTradeLineValueP628{font-size:8px!important}}


/* P10.24.72 UI-G — final coarse-pointer hit-area gate.
   The responsive authority owns the 44px token; this skin only ensures late
   feature rules cannot shrink live modal controls below that contract. */
@media (max-width:900px),(pointer:coarse){
  body.rrmModernUiP485 .rrmModalShellP102467 button,
  body.rrmModernUiP485 .rrmModalShellP102467 select{
    min-height:var(--rrm-touch-target)!important;
  }
  body.rrmModernUiP485 .rrmModalShellP102467 button{
    min-width:var(--rrm-touch-target)!important;
  }
  body.rrmModernUiP485 .rrmModalShellP102467 label:has(input[type="checkbox"]),
  body.rrmModernUiP485 .rrmModalShellP102467 label:has(input[type="radio"]){
    min-height:var(--rrm-touch-target)!important;
    align-items:center;
  }
  body.rrmModernUiP485 .bdQuantitySelector{
    grid-template-columns:var(--rrm-touch-target) minmax(52px,auto) var(--rrm-touch-target)!important;
    min-width:calc((2 * var(--rrm-touch-target)) + 60px)!important;
  }
  body.rrmModernUiP485 .bdQuantitySelector>button,
  body.rrmModernUiP485 .bdQuantityShortcuts>button{
    width:var(--rrm-touch-target)!important;
    min-width:var(--rrm-touch-target)!important;
    height:var(--rrm-touch-target)!important;
    min-height:var(--rrm-touch-target)!important;
  }
  body.rrmModernUiP485 .rrmMealLimitControlP102468{
    grid-column:1/-1!important;
    width:auto!important;
    min-width:max-content!important;
    justify-self:start!important;
  }
}

/* P10.24.72 UI-G — selectors with historical ID-specific sizing must not
   undercut the canonical coarse-pointer hit area. */
@media (max-width:900px),(pointer:coarse){
  body.rrmModernUiP485 .rrmModalShellP102467 :is(.rrmPanelClose,#wpClose,#sideCloseBtn,#objectPopupClose,#stockPanelClose,#scheduleCloseBtn),
  body.rrmModernUiP485 .rrmModalShellP102467 :is(#stockPriorityDown,#stockPriorityUp){
    width:var(--rrm-touch-target)!important;
    min-width:var(--rrm-touch-target)!important;
    height:var(--rrm-touch-target)!important;
    min-height:var(--rrm-touch-target)!important;
    max-width:none!important;
    max-height:none!important;
    flex-basis:var(--rrm-touch-target)!important;
  }
}

/* P10.24.72 UI-G — Work/Priorities coarse-pointer controls follow the same
   44px hit-area contract as the rest of the modal system. */
@media (max-width:900px),(pointer:coarse){
  body.rrmModernUiP485 #workPanel .wpScheduleBtn,
  body.rrmModernUiP485 #workPanel .wpPrioBox{
    width:var(--rrm-touch-target)!important;
    min-width:var(--rrm-touch-target)!important;
    height:var(--rrm-touch-target)!important;
    min-height:var(--rrm-touch-target)!important;
    flex-basis:var(--rrm-touch-target)!important;
  }
  body.rrmModernUiP485 #workPanel .wpColonistHead{
    grid-template-columns:minmax(0,1fr) var(--rrm-touch-target)!important;
  }
}


/* P10.24.94 — trade card compaction: quantity is only - / value / +.
   Coin value lives under stock/availability in the text column, never as a
   separate width-consuming grid column. */
body.rrmModernUiP485 .rrmTradeItemP628{
  grid-template-columns:36px minmax(0,1fr) minmax(142px,auto)!important;
  min-width:0!important;
}
body.rrmModernUiP485 .rrmTradeItemP628>.bdQuantitySelector{
  justify-self:end!important;
  width:max-content!important;
  max-width:100%!important;
}
body.rrmModernUiP485 .rrmTradeItemP628>.bdQuantitySelector .bdQuantityShortcuts{
  display:none!important;
}
body.rrmModernUiP485 .rrmTradeItemNameP628 .rrmTradeLineValueP628{
  display:block!important;
  margin-top:3px!important;
  text-align:left!important;
  color:var(--bd-title)!important;
  font-weight:800!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
@media(max-width:1000px) and (min-width:621px){
  body.rrmModernUiP485 .rrmTradeItemP628{
    grid-template-columns:28px minmax(0,1fr) minmax(132px,auto)!important;
  }
}
@media(max-width:620px){
  body.rrmModernUiP485 .rrmTradeItemP628{
    grid-template-columns:30px minmax(0,1fr) minmax(132px,auto)!important;
  }
}
/* Full-height popup content: keep the shell tall, while cards size to content. */
body.rrmModernUiP485 #sidePanel .rrmColonistProfile{
  flex:0 0 auto!important;height:auto!important;min-height:0!important;grid-template-rows:auto auto!important;
}
body.rrmModernUiP485 #sidePanel .rrmColonistCards{
  grid-template-rows:auto auto!important;align-items:start!important;
}
body.rrmModernUiP485 #sidePanel .rrmColonistSummaryRow{grid-template-columns:minmax(0,1fr)!important;}
body.rrmModernUiP485 #sidePanel .rrmColonistHero{height:auto!important;align-items:center!important;}
body.rrmModernUiP485 #sidePanel .rrmColonistAvatar{height:112px!important;min-height:0!important;}
body.rrmModernUiP485 #sidePanel .rrmEquipmentCard,
body.rrmModernUiP485 #sidePanel .rrmInventoryCard{height:auto!important;}
body.rrmModernUiP485 #sidePanel .rrmEquipmentGrid,
body.rrmModernUiP485 #sidePanel .rrmInventoryGrid{flex:0 0 auto!important;align-items:start!important;}
body.rrmModernUiP485 #sidePanel .rrmEquipmentSlot,
body.rrmModernUiP485 #sidePanel .rrmInventorySlot{height:64px!important;min-height:64px!important;}
body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMetaButton{
  width:max-content!important;
  max-width:min(100%,260px)!important;
  min-width:0!important;
  min-height:30px!important;
  font-size:12px!important;
  flex:0 0 auto!important;
  justify-self:start!important;
}
@media(max-width:520px){
  body.rrmModernUiP485 #sidePanel .rrmColonistHero{grid-template-columns:68px minmax(0,1fr)!important;}
  body.rrmModernUiP485 #sidePanel .rrmColonistAvatar{height:96px!important;}
  body.rrmModernUiP485 #sidePanel .rrmColonistCards{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"status" "mood" "equipment" "inventory"!important;
  }
  body.rrmModernUiP485 #sidePanel .rrmColonistName{font-size:20px!important;overflow-wrap:normal!important;}
  body.rrmModernUiP485 #sidePanel .rrmColonistMoodSummary{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
/* Independent full-screen readers use the same vertical policy as dense modals. */
.rrmSaveHistoryOverlay{padding-block:0;box-sizing:border-box;}
.rrmSaveHistoryDialog{height:100dvh;max-height:100dvh;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;border-radius:0;}
.rrmSaveHistoryHeader{flex:0 0 auto;}
.rrmSaveHistoryList{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;}
.rrmSaveHistoryRow{flex:0 0 auto;}
body.rrmModernUiP485 .rrmCharacterBiographyLayer{padding-block:0!important;box-sizing:border-box!important;}
body.rrmModernUiP485 .rrmCharacterBiographyPopup{height:100dvh!important;max-height:100dvh!important;box-sizing:border-box!important;border-radius:0!important;}
#researchList.rrmResearchTreeListP10190{flex-basis:0!important;}

/* Construction category tabs keep only the width required by their translated labels. */
@media (max-width:860px){
 body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs{display:flex!important;flex-wrap:nowrap!important;justify-content:flex-start!important;overflow-x:auto!important;overflow-y:hidden!important;flex-shrink:0!important;}
 body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildTabs button{flex:0 0 auto!important;min-width:max-content!important;width:max-content!important;max-width:none!important;white-space:nowrap!important;}
}


/* P10.24.97 — colonist header compaction and single-row status strip.
   Profession/work and mood controls size to their content; status bars remain
   on one horizontal line and scroll only when the viewport is too narrow. */
body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMeta{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:6px!important;
  width:100%!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMetaButton{
  display:inline-flex!important;
  width:max-content!important;
  max-width:100%!important;
  min-width:0!important;
  flex:0 0 auto!important;
  justify-self:auto!important;
  padding-inline:6px 10px!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMetaButton > span:last-child{
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(126px,1fr))!important;
  grid-auto-flow:column!important;
  gap:7px!important;
  align-items:stretch!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain!important;
  scrollbar-width:thin;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow{
  min-width:126px!important;
  width:auto!important;
  grid-template-columns:minmax(54px,auto) minmax(44px,1fr) auto!important;
  grid-template-areas:none!important;
  gap:5px!important;
  align-items:center!important;
  min-height:34px!important;
  padding:4px 6px!important;
  white-space:nowrap!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow > span,
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow > strong,
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedBar{
  grid-area:auto!important;
  margin:0!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow > span{
  white-space:nowrap!important;
  overflow-wrap:normal!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedBar{
  height:10px!important;
  min-width:44px!important;
}
@media(max-width:620px){
  body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMeta{
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmColonistMetaButton{
    width:max-content!important;
    max-width:none!important;
    min-height:24px!important;
    font-size:10px!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
    grid-template-columns:repeat(6,minmax(116px,1fr))!important;
    padding:6px!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow{
    min-width:116px!important;
    min-height:32px!important;
    font-size:10px!important;
  }
}


/* P10.25.3 — colonist needs moved into the top-right free area.
   Keep identity on the left and place Hunger/Health/Rest/Fun/Mood/Comfort
   in a compact grid on the right instead of spanning a full-width strip. */
body.rrmModernUiP485 #sidePanel .rrmColonistSummaryRow{
  grid-template-columns:minmax(300px,.88fr) minmax(440px,1.12fr)!important;
  align-items:start!important;
  gap:14px!important;
}
body.rrmModernUiP485 #sidePanel .rrmColonistHero{
  height:auto!important;
  min-height:136px!important;
  align-items:center!important;
  align-content:center!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(148px,1fr))!important;
  grid-auto-flow:row!important;
  gap:8px 10px!important;
  align-items:stretch!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding:10px!important;
  overflow:visible!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow{
  min-width:0!important;
  width:100%!important;
  grid-template-columns:minmax(54px,auto) minmax(56px,1fr) auto!important;
  gap:6px!important;
  align-items:center!important;
  min-height:36px!important;
  padding:5px 7px!important;
  white-space:nowrap!important;
}
body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedBar{
  height:12px!important;
  min-width:56px!important;
}
@media(max-width:980px){
  body.rrmModernUiP485 #sidePanel .rrmColonistSummaryRow{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
    grid-template-columns:repeat(2,minmax(148px,1fr))!important;
  }
}
@media(max-width:620px){
  body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
    grid-template-columns:minmax(0,1fr)!important;
    padding:8px!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow{
    min-height:34px!important;
    font-size:10px!important;
  }
}

/* P10.25.4 — keep colonist needs in the top-right on tablet/landscape.
   P10.25.3 incorrectly stacked the summary below 980 CSS px, which affected
   high-DPI landscape devices. The summary now stays two-column until the UI
   is genuinely narrow; only the needs grid changes density. */
@media (max-width:980px) and (min-width:621px){
  body.rrmModernUiP485 #sidePanel .rrmColonistSummaryRow{
    grid-template-columns:minmax(248px,.82fr) minmax(0,1.18fr)!important;
    gap:10px!important;
    align-items:start!important;
  }
  body.rrmModernUiP485 #sidePanel .rrmColonistHero{
    grid-template-columns:96px minmax(0,1fr)!important;
    gap:10px!important;
    min-height:132px!important;
  }
  body.rrmModernUiP485 #sidePanel .rrmColonistAvatar{
    width:96px!important;
    height:112px!important;
  }
  body.rrmModernUiP485 #sidePanel .rrmColonistAvatar img{
    width:82px!important;
    height:82px!important;
  }
  body.rrmModernUiP485 #sidePanel .rrmColonistName{
    font-size:24px!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmStatGrid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:7px!important;
    padding:8px!important;
    overflow:visible!important;
    min-width:0!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedRow{
    min-width:0!important;
    width:100%!important;
    grid-template-columns:minmax(48px,auto) minmax(42px,1fr) auto!important;
    gap:5px!important;
    min-height:34px!important;
    padding:4px 6px!important;
    font-size:11px!important;
  }
  body.rrmModernUiP485 #sidePanel #panelContent .rrmNeedBar{
    min-width:42px!important;
    height:10px!important;
  }
}
@media (max-width:620px){
  body.rrmModernUiP485 #sidePanel .rrmColonistSummaryRow{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
/* P10.25.27 — mobile-first popup actions: content-sized panels and comfortable touch. */
@media (max-width:900px),(pointer:coarse){
  body.rrmUiShellP475 .rrmModalShellP102467:not(#sidePanel):not(#eventAlert){
    border-radius:16px!important;
  }

  body.rrmUiShellP475 .rrmModalShellP102467 :is(.objectActionRow,.compactButtonsP25,.rrmPopupActions){
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(148px,1fr))!important;
    align-items:stretch!important;
    gap:8px!important;
    min-width:0!important;
  }

  body.rrmUiShellP475 .rrmModalShellP102467 :is(.objectActionRow,.compactButtonsP25,.rrmPopupActions) button{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    padding:8px 10px!important;
    text-align:left!important;
    white-space:normal!important;
    line-height:1.2!important;
    overflow-wrap:anywhere!important;
  }

  body.rrmUiShellP475 .rrmModalShellP102467 :is(.objectActionRow,.compactButtonsP25,.rrmPopupActions) button .uiSpriteIcon{
    width:20px!important;
    height:20px!important;
    flex:0 0 20px!important;
  }

  body.rrmUiShellP475 .rrmModalShellP102467 :is(.objectActionRow,.compactButtonsP25,.rrmPopupActions):empty,
  body.rrmUiShellP475 .rrmModalShellP102467 :is(.panelSection,.objectPopupSection,.statRow,.objectInfoLine):empty{
    display:none!important;
  }
}

/* P10.25.36 — o roster da colônia mantém avatar, nome, humor e ação sem colisão em portrait. */
@media(max-width:620px){
  #objectPopup.rrmColonyOverviewPopup .rrmColonyMainGrid{grid-template-columns:minmax(0,1fr)!important}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPanel{min-width:0}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow{
    grid-template-columns:32px minmax(0,1fr) 38px 44px!important;
    gap:5px!important;
    min-width:0!important;
    padding:4px 2px!important;
  }
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatar{width:30px;height:30px}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow>div{min-width:0;overflow:hidden}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow b{display:block;min-width:0;font-size:clamp(10px,3vw,12px);line-height:1.12;overflow-wrap:anywhere}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyMood{white-space:nowrap;text-align:right;font-size:9px}
  #objectPopup.rrmColonyOverviewPopup .rrmColonyDraftBtnP64249{width:44px!important;min-width:44px!important;min-height:44px!important;height:44px!important;padding:2px!important}
}

/* P10.25.36 — drawer mobile usa sprites temáticos no lugar de letras e sinais. */
body.rrmUiShellP475 .mobileDrawerGrid button .mobileDrawerIconP102536{display:flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center}
body.rrmUiShellP475 .mobileDrawerGrid button .mobileDrawerIconP102536 img{display:block;width:100%;height:100%;object-fit:contain;image-rendering:auto}
body.rrmUiShellP475 .mobileDrawerGrid button small{font-size:9px!important;line-height:1.05!important;white-space:normal;text-align:right!important;}

/* P10.25.39 — roster avatars are explicit profile actions with a mobile touch target. */
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow{
  grid-template-columns:44px minmax(0,1fr) 38px 44px!important;
  gap:6px!important;
}
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  padding:3px!important;
  cursor:pointer!important;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538 img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  border-radius:50%;
  object-fit:cover;
}
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538:focus-visible{
  outline:2px solid #f2c86d!important;
  outline-offset:2px;
}

/* P10.26.52 — profile and colony portraits use live pawn render layers. */
body.rrmModernUiP485 .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610{
  display:block!important;width:92px!important;height:92px!important;image-rendering:pixelated;
}
body.rrmModernUiP485 .rrmBiographyAvatar > canvas.rrmPawnPortraitCanvasP102610{
  display:block!important;width:84px!important;height:96px!important;image-rendering:pixelated;
}
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538 > canvas.rrmPawnPortraitCanvasP102610{
  display:block!important;width:100%!important;height:100%!important;border-radius:50%;image-rendering:pixelated;
}
/* These portrait canvases share the global game canvas element type. Reset its
   fullscreen positioning/background so each portrait stays inside its holder. */
body.rrmModernUiP485 .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610,
body.rrmModernUiP485 .rrmBiographyAvatar > canvas.rrmPawnPortraitCanvasP102610,
#objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538 > canvas.rrmPawnPortraitCanvasP102610{
  position:static!important;
  inset:auto!important;
  flex:0 0 auto!important;
  max-width:100%!important;
  max-height:100%!important;
  background:transparent!important;
}
body.rrmModernUiP485 .rrmBiographyAvatar{
  background:transparent!important;
}
@media(max-width:860px){
  body.rrmModernUiP485 .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610{width:72px!important;height:72px!important}
  body.rrmModernUiP485.rrmColonistFocusMobile .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610{width:58px!important;height:58px!important}
  body.rrmModernUiP485 #sidePanel .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610{width:82px!important;height:82px!important}
  body.rrmModernUiP485 .rrmBiographyAvatar > canvas.rrmPawnPortraitCanvasP102610{width:64px!important;height:68px!important}
}
@media(max-width:520px){
  body.rrmModernUiP485 #sidePanel .rrmColonistAvatar > canvas.rrmPawnPortraitCanvasP102610{width:58px!important;height:58px!important}
}

/* Raid mobilization stays readable and tappable in compact landscape popups. */
#eventAlert .eventAlertActions .raidDefenseAlertActionP102538{
  display:flex;
  flex:1 1 100%;
  flex-direction:column;
  min-width:0;
  gap:5px;
}
#eventAlert .raidDefenseActionBtnP102538{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  min-height:44px!important;
  padding:7px 10px!important;
  text-align:right!important;
}
#eventAlert .raidDefenseActionBtnP102538 img{
  display:block;
  flex:0 0 28px;
  width:28px;
  height:28px;
  object-fit:contain;
}
#eventAlert .raidDefenseActionBtnP102538 span{
  flex:1 1 auto;
  min-width:0;
  margin-left:auto;
  text-align:right;
  overflow-wrap:anywhere;
}
#eventAlert .raidDefenseActionBtnP102538:disabled{opacity:.58;cursor:not-allowed}
#eventAlert .raidDefenseAlertActionP102538 small{
  display:block;
  padding:0 2px;
  color:var(--bd-text-muted,#aeb8bd);
  font-size:11px;
  line-height:1.25;
}
@media(max-width:620px){
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnRow{
    grid-template-columns:44px minmax(0,1fr) 38px 44px!important;
    gap:5px!important;
  }
  #objectPopup.rrmColonyOverviewPopup .rrmColonyPawnAvatarButtonP102538{width:44px!important;height:44px!important}
  #eventAlert .eventAlertActions{align-items:stretch;flex-direction:column}
}

/* Restore compact construction tiles while keeping the information target
   large enough to tap on mobile. */
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem{
  box-sizing:border-box!important;
  height:84px!important;
  min-height:84px!important;
  max-height:84px!important;
}
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem .rrmUnifiedBuildCard{
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  min-height:84px!important;
  max-height:84px!important;
  padding-right:52px!important;
}
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn{
  position:absolute!important;
  z-index:3!important;
  top:0!important;
  right:0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:flex-end!important;
  box-sizing:border-box!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  padding:6px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--ui-info,var(--bd-info,#66b9cf))!important;
  box-shadow:none!important;
  font-size:0!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoGlyph{
  display:inline-grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  width:12px!important;
  min-width:12px!important;
  height:12px!important;
  min-height:12px!important;
  border:1px solid color-mix(in srgb,var(--ui-info,var(--bd-info,#66b9cf)) 78%,transparent)!important;
  border-radius:50%!important;
  background:transparent!important;
  background-image:none!important;
  color:inherit!important;
  font:800 8px/1 system-ui,sans-serif!important;
}
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn:hover .rrmBuildInfoGlyph,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn:focus-visible .rrmBuildInfoGlyph{
  border-color:var(--ui-warning,var(--bd-warning,#e2b84b))!important;
  color:var(--ui-warning,var(--bd-warning,#e2b84b))!important;
}
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn:focus-visible{
  outline:2px solid var(--ui-warning,var(--bd-warning,#e2b84b))!important;
  outline-offset:-2px!important;
}
@media (max-width:860px), (pointer:coarse){
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem{
    height:74px!important;
    min-height:74px!important;
    max-height:74px!important;
  }
  body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem .rrmUnifiedBuildCard{
    height:100%!important;
    min-height:74px!important;
    max-height:74px!important;
    padding-right:52px!important;
  }
  html[data-bd-theme] body.rrmModernUiP485.rrmUiShellP475 #buildMenu[data-unified-build-menu="1"] .rrmUnifiedBuildItem .rrmUnifiedBuildCard{
    height:74px!important;
    min-height:74px!important;
    max-height:74px!important;
  }
}

/* P10.26.68 — keep the colonist popup heading and a single close glyph in
   mobile landscape. The compact-focus rules previously hid the title and
   restored the button's fallback × beside its sprite. */
@media (max-width:900px), (pointer:coarse){
  html[data-bd-ui-skin] body.rrmModernUiP485.rrmSidePanelFocusMobile #sidePanel .sidePanelHeader{
    position:sticky!important;
    top:0!important;
    left:auto!important;
    right:auto!important;
    z-index:5!important;
    min-height:38px!important;
    margin:0!important;
    padding:5px 48px 5px 10px!important;
    justify-content:flex-start!important;
    gap:8px!important;
    background:var(--bd-panel,var(--rrm-modern-panel))!important;
    border:0!important;
    border-bottom:1px solid var(--bd-border-soft,var(--rrm-modern-line-soft))!important;
  }
  html[data-bd-ui-skin] body.rrmModernUiP485.rrmSidePanelFocusMobile #sidePanel .sidePanelTitle{
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    margin:0!important;
    overflow:hidden!important;
    position:static!important;
    color:var(--bd-selection,var(--rrm-modern-gold-2))!important;
    font-size:var(--rrm-type-popup-title,16px)!important;
    line-height:1.1!important;
    text-align:left!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html[data-bd-ui-skin] body.rrmModernUiP485.rrmSidePanelFocusMobile #sidePanel #sideCloseBtn.iconOnly{
    position:absolute!important;
    top:1px!important;
    right:2px!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    font-size:0!important;
    line-height:0!important;
    color:transparent!important;
  }
}

/* The sprite system adds a close icon without removing the legacy text glyph.
   Some later popup rules restored the button's font size, painting a second X. */
body.rrmModernUiP485 .rrmModalShellP102467 button[data-ui-sprite="button_close"].hasUiSpriteIcon{
  color:transparent!important;
  font-size:0!important;
  line-height:0!important;
  text-shadow:none!important;
}

/* Five canonical farm choices: prevent an implicit sixth grid track on touch
   screens; keep all five cards uniformly sized even in narrow viewports. */
@media (max-width: 440px){
  body.rrmModernUiP485 #farmPanel .panelSection{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:clamp(4px,1vw,8px)!important;
  }
  body.rrmModernUiP485 #farmPanel .panelSection > .rrmBuildCard.rrmFarmIconButton{
    width:100%!important;min-width:0!important;max-width:64px!important;
    height:auto!important;min-height:0!important;max-height:64px!important;
    aspect-ratio:1/1!important;justify-self:center!important;
  }
}
