/* P10.25.39 — shared popup, theme, icon and scroll contract.
   Features provide content and state; this file owns shared presentation. */
:root{
  --ui-space-1:4px;--ui-space-2:8px;--ui-space-3:12px;--ui-space-4:16px;--ui-space-5:24px;--ui-space-6:32px;
  --ui-radius-control:6px;--ui-radius-card:8px;--ui-radius-popup:10px;--ui-radius-pill:999px;
  --ui-text-title:18px;--ui-text-section:15px;--ui-text-body:14px;--ui-text-secondary:13px;--ui-text-caption:12px;--ui-text-value:20px;
  --ui-icon-size-xs:14px;--ui-icon-size-sm:16px;--ui-icon-size-md:20px;--ui-icon-size-lg:24px;--ui-icon-size-xl:32px;--ui-icon-size-hero:44px;
  --ui-touch-target:44px;
  --ui-scroll-threshold:8px;
  --ui-surface-0:var(--bd-bg-secondary,#0c2830);--ui-surface-1:var(--bd-panel,#102f37);--ui-surface-2:var(--bd-panel-alt,#143943);
  --ui-on-surface-0:var(--bd-text,#f3e6cf);--ui-on-surface-1:var(--bd-text,#f3e6cf);--ui-on-surface-2:var(--bd-text,#f3e6cf);
  --ui-border:var(--bd-border,#9b6b45);--ui-border-subtle:var(--bd-border-soft,#6f513a);
  --ui-accent:var(--bd-accent,#c7834a);--ui-on-accent:var(--bd-selection-text,#1a1610);
  --ui-positive:var(--bd-success,#79c96b);--ui-on-positive:#10210e;
  --ui-warning:var(--bd-warning,#e2b84b);--ui-on-warning:#211a08;
  --ui-danger:var(--bd-danger,#e06a62);--ui-on-danger:#24100e;
  --ui-info:var(--bd-info,#66b9cf);--ui-disabled:color-mix(in srgb,var(--ui-on-surface-1) 52%,var(--ui-surface-1));
  --ui-icon-primary:var(--ui-on-surface-1);--ui-icon-secondary:var(--bd-text-muted,#c9b99e);
  --ui-icon-muted:var(--ui-disabled);--ui-icon-accent:var(--ui-accent);--ui-icon-positive:var(--ui-positive);
  --ui-icon-warning:var(--ui-warning);--ui-icon-danger:var(--ui-danger);--ui-icon-disabled:var(--ui-disabled);
  --ui-shadow-panel:var(--bd-shadow-panel,0 4px 12px rgba(0,0,0,.42));--ui-shadow-popup:var(--bd-shadow-popup,0 12px 32px rgba(0,0,0,.5));
  --ui-font:var(--bd-font-ui,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);
}
html[data-bd-theme]{
  --ui-surface-0:var(--bd-bg-secondary);--ui-surface-1:var(--bd-panel);--ui-surface-2:var(--bd-panel-alt);
  --ui-on-surface-0:var(--bd-text);--ui-on-surface-1:var(--bd-text);--ui-on-surface-2:var(--bd-text);
  --ui-border:var(--bd-border);--ui-border-subtle:var(--bd-border-soft);
  --ui-accent:var(--bd-accent);--ui-on-accent:var(--bd-selection-text);
  --ui-positive:var(--bd-success);--ui-warning:var(--bd-warning);--ui-danger:var(--bd-danger);--ui-info:var(--bd-info);
  --ui-icon-primary:var(--bd-text);--ui-icon-secondary:var(--bd-text-muted);
  --ui-icon-muted:color-mix(in srgb,var(--bd-text-muted) 66%,var(--bd-panel));
  --ui-icon-accent:var(--bd-accent);--ui-icon-positive:var(--bd-success);--ui-icon-warning:var(--bd-warning);
  --ui-icon-danger:var(--bd-danger);--ui-icon-disabled:color-mix(in srgb,var(--bd-text-muted) 52%,var(--bd-panel));
  --ui-command-icon-plate:var(--bd-panel-alt,#143943);--ui-command-icon-rim:var(--bd-border,#9b6b45);
  --ui-command-icon-highlight:var(--bd-selection,var(--bd-accent,#c7834a));--ui-command-icon-ink:var(--bd-text,#f3e6cf);
  --ui-command-icon-warm:var(--bd-accent,#c7834a);--ui-command-icon-cool:var(--bd-info,#66b9cf);
  --ui-command-icon-deep:var(--bd-panel,#102f37);
  --ui-shadow-panel:var(--bd-shadow-panel);--ui-shadow-popup:var(--bd-shadow-popup);--ui-font:var(--bd-font-ui);
}

/* One visual shell shared by feature-specific popup content. */
body.rrmModernUiP485 .uiModalShell{
  box-sizing:border-box!important;min-width:0!important;
  border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius-popup)!important;
  background:var(--ui-surface-1)!important;color:var(--ui-on-surface-1)!important;
  box-shadow:var(--ui-shadow-popup)!important;font-family:var(--ui-font)!important;
  color-scheme:inherit;overscroll-behavior:contain;
}
body.rrmModernUiP485 .uiModalShell .rrmModalHeaderP102467{
  position:sticky!important;top:0!important;z-index:5!important;flex:0 0 auto!important;
  display:flex!important;align-items:center!important;gap:var(--ui-space-2)!important;
  min-height:48px!important;box-sizing:border-box!important;padding:var(--ui-space-2) 56px var(--ui-space-2) var(--ui-space-4)!important;
  border-bottom:1px solid var(--ui-border-subtle)!important;background:var(--ui-surface-1)!important;
  color:var(--ui-on-surface-1)!important;font:700 var(--ui-text-title)/1.2 var(--ui-font)!important;
  letter-spacing:normal!important;text-align:left!important;text-transform:none!important;
}
body.rrmModernUiP485 .uiModalShell .uiModalTitleIcon{width:var(--ui-icon-size-lg)!important;height:var(--ui-icon-size-lg)!important;flex:0 0 var(--ui-icon-size-lg)!important;}
body.rrmModernUiP485 .uiModalShell .uiModalHeader{touch-action:none!important;}
body.rrmModernUiP485 .uiModalShell .rrmModalBodyP102467{min-width:0!important;min-height:0!important;}
body.rrmModernUiP485 .uiModalShell :is(.panelSection,.objectPopupSection,.visitorCard,.rrmInfoCard){
  border-color:var(--ui-border-subtle)!important;border-radius:var(--ui-radius-card)!important;
}
body.rrmModernUiP485 .uiModalShell :is(h1,h2,h3,h4,.sectionTitle,.panelTitle){font-family:var(--ui-font)!important;}
body.rrmModernUiP485 .uiModalShell :is(p,small,.caption,.secondary-text){line-height:1.4;}

/* Semantic button variants and consistent focus/disabled states. */
body.rrmModernUiP485 .uiModalShell :is(button,input,select,textarea){font-family:var(--ui-font)!important;}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn){border-radius:var(--ui-radius-control);}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn):focus-visible{
  outline:2px solid var(--bd-focus,var(--ui-accent))!important;outline-offset:2px!important;
}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn):disabled,
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn)[aria-disabled="true"]{color:var(--ui-disabled)!important;cursor:not-allowed;}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn).primary,
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn).confirm,
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn)[data-ui-variant="primary"]{background:var(--ui-accent)!important;color:var(--ui-on-accent)!important;border-color:var(--ui-accent)!important;}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn).danger,
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn)[data-ui-variant="danger"]{background:var(--ui-danger)!important;color:var(--ui-on-danger)!important;border-color:var(--ui-danger)!important;}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn)[data-ui-variant="positive"]{background:var(--ui-positive)!important;color:var(--ui-on-positive)!important;border-color:var(--ui-positive)!important;}
body.rrmModernUiP485 .uiModalShell :is(button,.button,.btn)[data-ui-variant="warning"]{background:var(--ui-warning)!important;color:var(--ui-on-warning)!important;border-color:var(--ui-warning)!important;}
body.rrmModernUiP485 .uiModalShell :is(input,select,textarea){border-color:var(--ui-border-subtle);border-radius:var(--ui-radius-control);font-size:var(--ui-text-body);}
body.rrmModernUiP485 .uiModalShell :is(.uiModalFooter,[data-ui-modal-footer]){
  display:flex;align-items:center;justify-content:flex-end;gap:var(--ui-space-2);flex:0 0 auto;
  padding:var(--ui-space-3) var(--ui-space-4);border-top:1px solid var(--ui-border-subtle);background:var(--ui-surface-1);
}
body.rrmModernUiP485 .uiModalShell :is(.uiModalFooter,[data-ui-modal-footer])>:first-child{margin-right:auto;}

/* Illustrated system sprites retain their game palette and internal details.
   Resource/item artwork uses separate classes and is intentionally untouched. */
.uiSpriteIcon[data-icon-theme="semantic"]{
  display:inline-block!important;width:var(--ui-icon-size-md)!important;height:var(--ui-icon-size-md)!important;
  flex:0 0 var(--ui-icon-size-md)!important;background-image:var(--ui-sprite-url)!important;background-color:transparent!important;
  background-repeat:no-repeat!important;background-position:center!important;background-size:contain!important;
  -webkit-mask-image:none!important;mask-image:none!important;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.4))!important;pointer-events:none!important;
}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="primary"]{color:var(--ui-icon-primary)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="secondary"]{color:var(--ui-icon-secondary)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="muted"]{color:var(--ui-icon-muted)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="accent"]{color:var(--ui-icon-accent)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="positive"]{color:var(--ui-icon-positive)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="warning"]{color:var(--ui-icon-warning)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="danger"]{color:var(--ui-icon-danger)!important;}
.uiSpriteIcon[data-icon-theme="semantic"][data-icon-role="disabled"]{color:var(--ui-icon-disabled)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-theme="semantic"]{
  background-image:var(--ui-sprite-url)!important;background-color:transparent!important;background-repeat:no-repeat!important;
  background-position:center!important;background-size:contain!important;-webkit-mask-image:none!important;mask-image:none!important;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.4))!important;
}
.rrmMiniSprite.uiThemeIcon[data-icon-role="primary"]{color:var(--ui-icon-primary)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-role="secondary"]{color:var(--ui-icon-secondary)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-role="accent"]{color:var(--ui-icon-accent)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-role="positive"]{color:var(--ui-icon-positive)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-role="warning"]{color:var(--ui-icon-warning)!important;}
.rrmMiniSprite.uiThemeIcon[data-icon-role="danger"]{color:var(--ui-icon-danger)!important;}
@supports not (mask-image:url("")){
  .rrmMiniSprite.uiThemeIcon[data-icon-theme="semantic"]{background-color:transparent!important;background-image:var(--ui-sprite-url)!important;}
}
body.rrmModernUiP485 .uiModalShell button:disabled>.uiSpriteIcon[data-icon-theme="semantic"],
body.rrmModernUiP485 .uiModalShell button[aria-disabled="true"]>.uiSpriteIcon[data-icon-theme="semantic"]{color:var(--ui-icon-disabled)!important;}
body.rrmModernUiP485 .uiModalShell button:is(.active,.selected,[aria-pressed="true"],[aria-selected="true"])>.uiSpriteIcon[data-icon-theme="semantic"]{color:var(--ui-icon-accent)!important;}
body.rrmModernUiP485 .uiModalShell button:is(.danger,.destructive,[data-ui-variant="danger"])>.uiSpriteIcon[data-icon-theme="semantic"]{color:var(--ui-icon-danger)!important;}
body.rrmModernUiP485 .uiModalShell button:is(.warning,[data-ui-variant="warning"])>.uiSpriteIcon[data-icon-theme="semantic"]{color:var(--ui-icon-warning)!important;}
body.rrmModernUiP485 .uiModalShell button:is(.success,.positive,[data-ui-variant="positive"])>.uiSpriteIcon[data-icon-theme="semantic"]{color:var(--ui-icon-positive)!important;}
body.rrmModernUiP485 .uiModalShell .rrmDiplomacyCardTitleP6430>span>.uiSpriteIcon{width:25px!important;height:25px!important;flex-basis:25px!important;}
body.rrmModernUiP485 .uiModalShell .rrmDiplomacySectionTitleP6430>span>.uiSpriteIcon{width:28px!important;height:28px!important;flex-basis:28px!important;}
body.rrmModernUiP485 .uiModalShell .rrmDiplomacyEventIconP6430{width:20px!important;height:20px!important;flex-basis:20px!important;margin:auto!important;}
body.rrmModernUiP485 .uiModalShell .rrmDiplomacyEventEmptyP6436>.uiSpriteIcon{width:24px!important;height:24px!important;flex-basis:24px!important;}
body.rrmModernUiP485 .uiModalShell .rrmFactionActionsP6430 button span>.uiSpriteIcon{width:18px!important;height:18px!important;flex-basis:18px!important;}
body.rrmModernUiP485 :is(button.iconOnly.hasUiSpriteIcon:not(#speedBtn),.panelTabs button.hasUiSpriteIcon){background-image:none!important;}
@supports not (mask-image:url("")){
  .uiSpriteIcon[data-icon-theme="semantic"]{background-color:transparent!important;background-image:var(--ui-sprite-url)!important;}
}
body.rrmModernUiP485 .uiModalShell button.hasUiSpriteIcon:not(#speedBtn){display:inline-flex!important;align-items:center!important;}
body.rrmModernUiP485 .uiModalShell button.hasUiSpriteIcon:not(.iconOnly):not(.pm-close):not(.wpClose):not(.rrmPanelClose):not(.popupCloseX){
  justify-content:space-between!important;text-align:right!important;gap:var(--ui-space-2)!important;
}
body.rrmModernUiP485 .uiModalShell button.hasUiSpriteIcon:not(.iconOnly):not(.pm-close):not(.wpClose):not(.rrmPanelClose):not(.popupCloseX)>.uiSpriteIcon{margin-right:auto!important;}
body.rrmModernUiP485 .uiModalShell button.iconOnly.hasUiSpriteIcon:not(#speedBtn),
body.rrmModernUiP485 .uiModalShell .panelTabs button.hasUiSpriteIcon{background-image:none!important;}
body.rrmModernUiP485 .uiModalShell button.iconOnly.hasUiSpriteIcon:not(#speedBtn)>.uiSpriteIcon{width:var(--ui-icon-size-lg)!important;height:var(--ui-icon-size-lg)!important;flex-basis:var(--ui-icon-size-lg)!important;}
body.rrmModernUiP485 .uiModalShell :is(.rrmPanelClose,#sideCloseBtn,#objectPopupClose,#wpClose,#stockPanelClose,#scheduleCloseBtn,#saveHistoryCloseBtn,.settingsCloseBtn,.popupCloseX){
  display:grid!important;place-items:center!important;width:var(--ui-touch-target)!important;min-width:var(--ui-touch-target)!important;
  height:var(--ui-touch-target)!important;min-height:var(--ui-touch-target)!important;padding:0!important;
  border:0!important;border-radius:0!important;background:transparent!important;background-image:none!important;box-shadow:none!important;
  color:transparent!important;font-size:0!important;line-height:0!important;text-shadow:none!important;
}
body.rrmModernUiP485 .uiModalShell :is(.rrmPanelClose,#sideCloseBtn,#objectPopupClose,#wpClose,#stockPanelClose,#scheduleCloseBtn,#saveHistoryCloseBtn,.settingsCloseBtn,.popupCloseX)>.uiSpriteIcon{
  width:var(--ui-icon-size-md)!important;height:var(--ui-icon-size-md)!important;flex-basis:var(--ui-icon-size-md)!important;
}
/* Legacy close-button rules hide the label with color:transparent; restore the
   icon's own theme color so the icon-only control remains visibly actionable. */
body.rrmModernUiP485 .uiModalShell :is(.rrmPanelClose,#sideCloseBtn,#objectPopupClose,#wpClose,#stockPanelClose,#scheduleCloseBtn,#saveHistoryCloseBtn,.settingsCloseBtn,.popupCloseX)>.uiSpriteIcon[data-icon-theme="semantic"]{
  color:var(--ui-icon-secondary)!important;background-color:transparent!important;
}
body.rrmModernUiP485 #schedulePopup .scheduleHeaderIconP102502{
  background-color:var(--ui-icon-accent)!important;background-image:none!important;
  -webkit-mask-image:url("../assets/sprites/UI/button_schedule.svg?v=P10.25.39-canonical-ui-v1")!important;
  mask-image:url("../assets/sprites/UI/button_schedule.svg?v=P10.25.39-canonical-ui-v1")!important;
  -webkit-mask-repeat:no-repeat!important;mask-repeat:no-repeat!important;-webkit-mask-position:center!important;mask-position:center!important;
  -webkit-mask-size:contain!important;mask-size:contain!important;mask-mode:alpha;
}

/* Native browser scroll starts on the surface or any descendant. Auto chaining
   lets a nested list hand off to its parent at an edge; modal shell contains page scroll. */
.uiScrollableSurface{overscroll-behavior:auto!important;scrollbar-color:var(--ui-border) var(--ui-surface-0);scrollbar-width:thin;}
.uiScrollableSurface *{overscroll-behavior:auto!important;}
.uiScrollableSurface[data-ui-scroll-axis="y"]{touch-action:pan-y;}
.uiScrollableSurface[data-ui-scroll-axis="both"]{touch-action:pan-x pan-y;}
.uiScrollableSurface :is(button,a,[role="button"],.card,.panelSection,.objectPopupSection){touch-action:manipulation;}
.uiScrollableSurface :is(.nestedScroll,[data-ui-scroll-owner="true"]){overscroll-behavior:auto!important;}

@media(max-width:900px),(pointer:coarse){
  body.rrmModernUiP485 .uiModalShell{border-radius:var(--ui-radius-popup)!important;}
  body.rrmModernUiP485 .uiModalShell .rrmModalHeaderP102467{min-height:44px!important;padding:6px 52px 6px 12px!important;font-size:var(--ui-text-title)!important;}
  body.rrmModernUiP485 .uiModalShell button.iconOnly:not(#speedBtn){min-width:var(--ui-touch-target)!important;min-height:var(--ui-touch-target)!important;}
  body.rrmModernUiP485 .uiModalShell .rrmDiplomacyCardTitleP6430>span>.uiSpriteIcon{width:21px!important;height:21px!important;flex-basis:21px!important;}
  body.rrmModernUiP485 .uiModalShell .rrmFactionActionsP6430 button span>.uiSpriteIcon{width:13px!important;height:13px!important;flex-basis:13px!important;}
}

/* P10.25.39 — save actions use a real modal body so the title stays fixed and
   only the action area scrolls on small landscape screens. */
body.rrmModernUiP485 #savePanel.rrmModalShellP102467{
  flex-direction:column!important;
  align-items:stretch!important;
  gap:8px!important;
  padding:10px!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
body.rrmModernUiP485 #savePanel.rrmModalShellP102467>.rrmModalHeaderP102467{
  position:sticky!important;
  top:0!important;
  z-index:5!important;
  flex:0 0 auto!important;
  align-self:stretch!important;
  margin:-10px -10px 0!important;
  padding:8px 54px 8px 14px!important;
}
body.rrmModernUiP485 #savePanel.rrmModalShellP102467>.savePanelBody{
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  align-self:stretch!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  padding:8px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  box-sizing:border-box!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}
body.rrmModernUiP485 #savePanel .savePanelActions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-content:start!important;
  align-self:stretch!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
body.rrmModernUiP485 #savePanel .savePanelAction{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  max-width:100%!important;
  margin:0!important;
  padding:7px 10px!important;
  white-space:normal!important;
  line-height:1.2!important;
  text-align:center!important;
  overflow-wrap:anywhere!important;
  touch-action:manipulation!important;
}
body.rrmModernUiP485 #savePanel #newGamePanelBtn{grid-column:1 / -1!important;}
body.rrmModernUiP485 #savePanel #saveStatus{
  flex:0 0 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:38px!important;
  margin:0!important;
  padding:8px 10px!important;
  box-sizing:border-box!important;
  overflow-wrap:anywhere!important;
}

/* Compact icon controls to keep every top HUD button inside its rail. */
@media(max-width:900px),(pointer:coarse){
body.rrmModernUiP485 .hudTop.compactHudTop{
  box-sizing:border-box!important;
  min-height:32px!important;
  height:var(--rrm-topbar-height,38px)!important;
  max-height:var(--rrm-topbar-height,38px)!important;
  padding:1px 3px!important;
  gap:2px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
}
body.rrmModernUiP485 .hudTop.compactHudTop .iconPill{
  box-sizing:border-box!important;
  height:28px!important;
  min-height:28px!important;
  max-height:28px!important;
  padding:1px 4px!important;
  gap:3px!important;
  line-height:1!important;
  flex:0 0 auto!important;
}
body.rrmModernUiP485 .hudTop.compactHudTop .widePill{
  min-width:0!important;
  max-width:min(360px,42vw)!important;
  overflow:hidden!important;
}
body.rrmModernUiP485 .hudTop.compactHudTop>.iconOnly{
  box-sizing:border-box!important;
  width:28px!important;
  min-width:28px!important;
  max-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  max-height:28px!important;
  flex:0 0 28px!important;
  padding:0!important;
  border-radius:7px!important;
}
body.rrmModernUiP485 .hudTop.compactHudTop>#speedBtn{
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  flex-basis:40px!important;
  padding:0 3px!important;
}
body.rrmModernUiP485 .hudTop.compactHudTop>.iconOnly>.uiSpriteIcon,
body.rrmModernUiP485 .hudTop.compactHudTop>.iconOnly>.rrmHudPngIcon{
  width:17px!important;
  height:17px!important;
  min-width:17px!important;
  min-height:17px!important;
  flex-basis:17px!important;
}
/* Theme defaults reserve 44px for all touch controls. The top rail is a dense
   utility strip, so override only its controls while keeping popup targets full size. */
html[data-bd-theme] body.rrmModernUiP485 .hudTop.compactHudTop .iconPill{
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  padding:1px 4px!important;
}
html[data-bd-theme] body.rrmModernUiP485 .hudTop.compactHudTop :is(#pauseBtn,#zoomOut,#zoomIn,#saveBtn,#debugDownloadBtn,#overlayBtn,#infoBtn,#settingsHudBtn,#fullscreenBtn){
  width:34px!important;
  min-width:34px!important;
  max-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  flex:0 0 34px!important;
  padding:0!important;
}
html[data-bd-theme] body.rrmModernUiP485 .hudTop.compactHudTop #speedBtn{
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  flex:0 0 40px!important;
  padding:0 3px!important;
}
}

/* The information target remains touch-sized; only its small glyph is drawn. */
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn{
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn::before,
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn::after,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn::before,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoBtn::after{
  content:none!important;
  display:none!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-bd-theme] body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoGlyph,
body.rrmModernUiP485 #buildMenu[data-unified-build-menu="1"] .rrmBuildInfoGlyph{
  border-radius:50%!important;
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

@media(max-width:520px){
  body.rrmModernUiP485 #savePanel .savePanelActions{gap:6px!important;}
  body.rrmModernUiP485 #savePanel .savePanelAction{min-height:46px!important;padding:6px 7px!important;}
  body.rrmModernUiP485 .hudTop.compactHudTop .widePill{max-width:min(250px,38vw)!important;}
}

/* P10.25.41 — the former bottom command strip is a fixed-footprint dock.
   The full-width shell stays transparent over the map; only the command tray
   and its permanently anchored trigger receive input. */
body.game-active .hudBottom[data-command-dock-ready="true"]{
  position:absolute!important;left:0!important;right:0!important;bottom:0!important;
  display:flex!important;align-items:flex-end!important;justify-content:flex-end!important;
  gap:8px!important;width:100vw!important;max-width:100vw!important;box-sizing:border-box!important;
  height:auto!important;min-height:0!important;max-height:none!important;transform:none!important;translate:none!important;
  padding:0 max(8px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important;
  overflow:visible!important;background:transparent!important;backdrop-filter:none!important;
  pointer-events:none!important;z-index:var(--rrm-z-hud,20000)!important;
}
/* Theme selectors intentionally style the normal full-width HUD with high
   specificity. The dock shell itself must remain unpainted when collapsed. */
html[data-bd-theme] body.game-active .hudBottom[data-command-dock-ready="true"]{
  background:transparent!important;background-image:none!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>.buttons{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:nowrap!important;
  width:max-content!important;min-width:0!important;max-width:0!important;max-height:48px!important;
  flex:0 1 auto!important;gap:0!important;padding:0!important;margin:0!important;border:0!important;
  overflow:hidden!important;overflow-x:hidden!important;overscroll-behavior-x:contain!important;
  scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x!important;
  visibility:hidden!important;opacity:0!important;pointer-events:none!important;
  background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;
  transform:translateX(12px)!important;
  transition:max-width 180ms ease,opacity 180ms ease,transform 180ms ease!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>.buttons::-webkit-scrollbar{display:none!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockToggle{
  position:relative!important;z-index:var(--rrm-z-hud,20000)!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 44px!important;width:44px!important;min-width:44px!important;max-width:44px!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;padding:0!important;margin:0!important;
  border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;
  border-radius:12px!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;
  background:linear-gradient(180deg,var(--bd-surface,var(--ui-surface-1,#143943)),var(--bd-panel,var(--ui-surface-0,#0c2830)))!important;
  box-shadow:var(--bd-shadow-panel,0 4px 16px rgba(0,0,0,.36))!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;touch-action:manipulation!important;
  outline-offset:2px!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockToggle:focus-visible{
  outline:2px solid var(--bd-accent,var(--ui-focus-ring,#d5a653))!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockToggle>.uiSpriteIcon{
  width:var(--ui-icon-size-md,20px)!important;height:var(--ui-icon-size-md,20px)!important;flex-basis:var(--ui-icon-size-md,20px)!important;
  transition:transform 180ms ease!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]:not([data-command-dock-state="expanded"])>.buttons{
  width:0!important;max-width:0!important;flex-basis:0!important;gap:0!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>.buttons{
  width:max-content!important;
  max-width:calc(100vw - max(8px,env(safe-area-inset-left,0px)) - max(8px,env(safe-area-inset-right,0px)) - 68px)!important;
  max-height:52px!important;gap:7px!important;padding:5px 8px!important;
  overflow-x:auto!important;overflow-y:hidden!important;visibility:visible!important;opacity:1!important;
  pointer-events:auto!important;transform:translateX(0)!important;
  border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;
  border-radius:14px!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;
  background:linear-gradient(180deg,var(--bd-panel,var(--ui-surface-1,#143943)),var(--bd-bg-secondary,var(--ui-surface-0,#0c2830)))!important;
  box-shadow:var(--bd-shadow-panel,0 6px 20px rgba(0,0,0,.38))!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockToggle>.uiSpriteIcon{
  transform:scaleX(-1)!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>.buttons>button{
  flex-shrink:0!important;touch-action:manipulation!important;
}
/* Older responsive sheets hide iconOnly commands because they assumed the
   collapsed rail and its drawer were the only mobile navigation. In the dock,
   every eligible command button is a direct, horizontally scrollable item.
   The hidden attribute remains authoritative for progression and Debug gating. */
html[data-bd-theme] body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>button:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>button:not([hidden]){
  display:inline-flex!important;
  flex-shrink:0!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#markBtn{order:1!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#buildBtn{order:2!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#centerBtn{order:3!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#workBtn{order:4!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#researchBtn{order:5!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#visitorsBtn{order:6!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#externalMapBtn{order:7!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#stockBtn{order:8!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#farmBtn{order:9!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#balanceBtn{order:10!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#economyBtn{order:11!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#eventsBtn{order:12!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#storyBtn{order:13!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#recreationBtn{order:14!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#baseDefenseBtn{order:15!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>[data-debug-only="true"]{order:99!important;}
body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>.buttons>button[data-debug-only="true"][hidden]{
  display:none!important;
}
@media(max-width:900px),(pointer:coarse){
  body.game-active .hudBottom[data-command-dock-ready="true"]{gap:6px!important;}
  body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockToggle{
    flex-basis:48px!important;width:48px!important;min-width:48px!important;max-width:48px!important;
    height:48px!important;min-height:48px!important;max-height:48px!important;border-radius:13px!important;
  }
  body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>.buttons{
    max-width:calc(100vw - max(8px,env(safe-area-inset-left,0px)) - max(8px,env(safe-area-inset-right,0px)) - 54px)!important;
    gap:5px!important;padding:3px 5px!important;
  }
}

/* Theme-linked illustrated command icons. The six navigation buttons keep
   one readable pictogram family; each color theme supplies its own palette
   through the existing --bd-* tokens above. */
html body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button[data-theme-command-icon]>.uiSpriteIcon.uiThemeCommandGlyph{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  background-image:none!important;background-color:transparent!important;
  -webkit-mask-image:none!important;mask-image:none!important;overflow:visible!important;
}
#bottomCommandDockCommands .uiSpriteIcon.uiThemeCommandGlyph{background-image:none!important;}
.themeCommandSpriteFrame{
  display:block!important;width:100%!important;height:100%!important;flex:0 0 100%!important;
  background-image:var(--theme-command-sprite-url,url("../assets/sprites/UI/bottom_hud_command_icons_atlas.png?v=P10.26.04-bottom-hud-png-atlas-v1"))!important;
  background-repeat:no-repeat!important;background-size:600% 7700%!important;
  background-position:var(--theme-command-sprite-x,0%) var(--theme-command-sprite-y,0%)!important;
  pointer-events:none!important;
}
#bottomCommandDockCommands>button[data-theme-command-icon]>.uiSpriteIcon.uiThemeCommandGlyph>.themeCommandGlyphSvg{
  display:block!important;width:100%!important;height:100%!important;overflow:visible!important;
}
.themeCommandGlyphSvg .tcg-plate{fill:var(--ui-command-icon-plate);stroke:var(--ui-command-icon-rim);stroke-width:2.4;}
.themeCommandGlyphSvg .tcg-rim{fill:none;stroke:var(--ui-command-icon-highlight);stroke-width:1.35;opacity:.95;}
.themeCommandGlyphSvg .tcg-main{fill:var(--ui-command-icon-ink);stroke:var(--ui-command-icon-deep);stroke-width:1.55;stroke-linejoin:round;}
.themeCommandGlyphSvg .tcg-warm{fill:var(--ui-command-icon-warm);stroke:var(--ui-command-icon-deep);stroke-width:1.4;stroke-linejoin:round;}
.themeCommandGlyphSvg .tcg-cool{fill:var(--ui-command-icon-cool);stroke:var(--ui-command-icon-deep);stroke-width:1.25;stroke-linejoin:round;}
.themeCommandGlyphSvg .tcg-detail{fill:none;stroke:var(--ui-command-icon-deep);stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg .tcg-cool-line{fill:none;stroke:var(--ui-command-icon-cool);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg .tcg-dot{fill:var(--ui-command-icon-highlight);stroke:var(--ui-command-icon-deep);stroke-width:1.1;}
.themeCommandGlyphSvg.s10 .tcg-main,.themeCommandGlyphSvg.s10 .tcg-warm,.themeCommandGlyphSvg.s10 .tcg-cool{stroke-width:2.1;}
.themeCommandGlyphSvg.s10 .tcg-detail{stroke-width:2.65;}
.themeCommandGlyphSvg.s10 .tcg-dot{stroke-width:1.45;}
/* Soft outlined cartoon icons for the bottom HUD command collection. */
.themeCommandGlyphSvg.s10{filter:saturate(.76);}
.themeCommandGlyphSvg.s10 .plate,.themeCommandGlyphSvg.s10 .ring{display:none;}
.themeCommandGlyphSvg.s10 .c10-ink{stroke:#29282a;stroke-width:3.6;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg.s10 .c10-skin{fill:#e8bd9b;}
.themeCommandGlyphSvg.s10 .c10-cuff,.themeCommandGlyphSvg.s10 .c10-sleeve-blue,.themeCommandGlyphSvg.s10 .c10-steel,.themeCommandGlyphSvg.s10 .c10-book-blue,.themeCommandGlyphSvg.s10 .c10-board{fill:var(--ui-command-icon-cool);}
.themeCommandGlyphSvg.s10 .c10-handle,.themeCommandGlyphSvg.s10 .c10-sleeve-gold,.themeCommandGlyphSvg.s10 .c10-book-gold,.themeCommandGlyphSvg.s10 .c10-wood{fill:var(--ui-command-icon-warm);}
.themeCommandGlyphSvg.s10 .c10-highlight{fill:var(--ui-command-icon-highlight);}
.themeCommandGlyphSvg.s10 .c10-paper,.themeCommandGlyphSvg.s10 .c10-canopy{fill:var(--ui-command-icon-ink);}
.themeCommandGlyphSvg.s10 .c10-pages{fill:#f1e3ca;}
.themeCommandGlyphSvg.s10 .c10-clip,.themeCommandGlyphSvg.s10 .c10-book-red{fill:#bd7f79;}
.themeCommandGlyphSvg.s10 .c10-check{fill:none;stroke:var(--ui-command-icon-cool);stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg.s10 .c10-line,.themeCommandGlyphSvg.s10 .c10-book-edge,.themeCommandGlyphSvg.s10 .c10-canopy-line{fill:none;stroke:#68777b;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg.s10 .c10-bookmark{fill:#bd7f79;}
.themeCommandGlyphSvg.s10 .c10-hand-line,.themeCommandGlyphSvg.s10 .c10-crease{fill:none;stroke:#aa8069;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;}
.themeCommandGlyphSvg.s10 .c10-wheel{fill:#e7d6ba;}
.themeCommandGlyphSvg.s10 .c10-hub{fill:var(--ui-command-icon-warm);}
.themeCommandGlyphSvg.s10 .c10-axle,.themeCommandGlyphSvg.s10 .c10-spoke{fill:none;stroke:#51463d;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
@media(prefers-reduced-motion:reduce){
  body.game-active .hudBottom[data-command-dock-ready="true"]>.buttons,
  body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockToggle>.uiSpriteIcon{
    transition:none!important;
  }
}

/* P10.25.45 — the primary Bottom HUD is an icon rail, not a command catalog.
   Other existing commands remain in the DOM for their systems and are
   reachable through their own surfaces; only this ordered player set is in
   the rail. The Debug trigger is additionally gated by the canonical flag. */
html body.game-active.rrmUiShellP475 .hudBottom .buttons#bottomCommandDockCommands>button:not(#markBtn):not(#buildBtn):not(#workBtn):not(#researchBtn):not(#visitorsBtn):not(#externalMapBtn):not(#bottomCommandDockDebugToggle){display:none!important;}
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#markBtn:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#buildBtn:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#workBtn:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#researchBtn:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#visitorsBtn:not([hidden]),
html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#externalMapBtn:not([hidden]){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 54px!important;width:54px!important;min-width:54px!important;max-width:54px!important;
  height:54px!important;min-height:54px!important;max-height:54px!important;padding:0!important;font-size:0!important;
  gap:0!important;overflow:hidden!important;text-indent:0!important;white-space:nowrap!important;
}
html body.game-active.rrmUiShellP475.rrmDebugUiEnabledP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#bottomCommandDockDebugToggle:not([hidden]){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 54px!important;width:54px!important;min-width:54px!important;max-width:54px!important;
  height:54px!important;min-height:54px!important;max-height:54px!important;padding:0!important;font-size:0!important;
  gap:0!important;overflow:hidden!important;text-indent:0!important;white-space:nowrap!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>.rrmModernHudButton>.rrmModernHudLabel,
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>.rrmModernHudButton>small,
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>.rrmModernHudButton>.rrmHudLabel{
  display:none!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button>.uiSpriteIcon{
  display:block!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  flex:0 0 34px!important;margin:0!important;transform:none!important;
}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#markBtn{order:1!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#buildBtn{order:2!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#workBtn{order:3!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#researchBtn{order:4!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#visitorsBtn{order:5!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#externalMapBtn{order:6!important;}
body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>#bottomCommandDockDebugToggle{order:7!important;}
body.game-active.rrmUiShellP475 .hudTop button[data-debug-only="true"]{display:none!important;}

/* Reuse the previous mobile drawer surface as a Debug-only icon/label menu. */
html body.game-active.rrmUiShellP475 #mobileDrawer.rrmDebugCommandMenuP102542{
  position:fixed!important;display:none!important;visibility:hidden!important;pointer-events:none!important;
  left:max(8px,env(safe-area-inset-left,0px))!important;
  right:max(8px,env(safe-area-inset-right,0px))!important;
  bottom:calc(max(8px,env(safe-area-inset-bottom,0px)) + 64px)!important;
  width:auto!important;max-width:680px!important;margin-left:auto!important;margin-right:auto!important;
  max-height:min(54dvh,460px)!important;padding:10px!important;overflow:hidden!important;
  border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;
  border-radius:16px!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;
  background:linear-gradient(180deg,var(--bd-panel,var(--ui-surface-1,#143943)),var(--bd-bg-secondary,var(--ui-surface-0,#0c2830)))!important;
  box-shadow:var(--bd-shadow-panel,0 14px 36px rgba(0,0,0,.42))!important;
  z-index:var(--rrm-z-drawer,70000)!important;grid-template-rows:auto minmax(0,1fr)!important;gap:8px!important;
}
html body.game-active.rrmUiShellP475 #mobileDrawer.rrmDebugCommandMenuP102542.open:not([hidden]){
  display:grid!important;visibility:visible!important;pointer-events:auto!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .rrmDebugDrawerHeaderP102542{
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
  min-width:0!important;padding:2px 2px 8px!important;border-bottom:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;
  color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;font-weight:800!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDebugDrawerCloseP102542{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 44px!important;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;
  border:0!important;background:transparent!important;box-shadow:none!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDrawerGrid{
  display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:7px!important;
  min-height:0!important;overflow:auto!important;overscroll-behavior:contain!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDebugCommandP102542{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;
  min-width:0!important;min-height:52px!important;padding:7px 10px!important;text-align:left!important;
  white-space:normal!important;overflow-wrap:anywhere!important;touch-action:manipulation!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDrawerIconP102536{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 32px!important;
  width:32px!important;height:32px!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDebugMenuIconP102542{
  display:block!important;width:28px!important;height:28px!important;background-image:var(--debug-menu-icon-url)!important;
  background-position:center!important;background-repeat:no-repeat!important;background-size:contain!important;
}
body.game-active #mobileDrawer.rrmDebugCommandMenuP102542 .mobileDebugCommandP102542>small{
  display:block!important;flex:1 1 auto!important;min-width:0!important;font-size:13px!important;line-height:1.2!important;
  text-align:left!important;white-space:normal!important;overflow-wrap:anywhere!important;
}
@media(max-width:900px),(pointer:coarse){
  body.game-active .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands{max-height:62px!important;}
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#markBtn:not([hidden]),
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#buildBtn:not([hidden]),
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#workBtn:not([hidden]),
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#researchBtn:not([hidden]),
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#visitorsBtn:not([hidden]),
  html body.game-active.rrmUiShellP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#externalMapBtn:not([hidden]){
    flex-basis:56px!important;width:56px!important;min-width:56px!important;max-width:56px!important;
    height:56px!important;min-height:56px!important;max-height:56px!important;
  }
  html body.game-active.rrmUiShellP475.rrmDebugUiEnabledP475 .hudBottom[data-command-dock-ready="true"][data-command-dock-state="expanded"]>#bottomCommandDockCommands>#bottomCommandDockDebugToggle:not([hidden]){
    flex-basis:56px!important;width:56px!important;min-width:56px!important;max-width:56px!important;
    height:56px!important;min-height:56px!important;max-height:56px!important;
  }
  html body.game-active.rrmUiShellP475 #mobileDrawer.rrmDebugCommandMenuP102542{
    left:max(6px,env(safe-area-inset-left,0px))!important;right:max(6px,env(safe-area-inset-right,0px))!important;
    bottom:calc(max(6px,env(safe-area-inset-bottom,0px)) + 62px)!important;max-width:none!important;
    max-height:min(58dvh,430px)!important;
  }
}

/* P10.25.48 — the illustrated glyph is the only visible control surface.
   Keep the full square button as its touch target, but center the circular
   sprite and remove the second, rectangular border/background around it. */
html body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button[data-theme-command-icon]{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex-direction:row!important;gap:0!important;padding:0!important;margin:0!important;
  border:0!important;border-radius:50%!important;
  background:transparent!important;background-image:none!important;background-color:transparent!important;
  box-shadow:none!important;text-align:center!important;outline:none!important;
  touch-action:manipulation!important;
}
html body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button[data-theme-command-icon]>.uiSpriteIcon.uiThemeCommandGlyph{
  align-self:center!important;justify-self:center!important;margin:0!important;
  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;
}
html body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button[data-theme-command-icon]:focus-visible>.uiSpriteIcon.uiThemeCommandGlyph{
  outline:2px solid var(--bd-accent,var(--ui-focus-ring,#d5a653))!important;outline-offset:2px!important;border-radius:50%!important;
}
@media(max-width:900px),(pointer:coarse){
  html body.game-active .hudBottom[data-command-dock-ready="true"]>#bottomCommandDockCommands>button[data-theme-command-icon]>.uiSpriteIcon.uiThemeCommandGlyph{
    width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;
    max-width:50px!important;max-height:50px!important;flex:0 0 50px!important;
  }
}

/* P10.25.49 — browse the full icon collection directly beneath color themes. */
.settingsIconCollectionSection{
  min-width:0!important;margin:0 0 14px!important;padding:12px!important;
  border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;
  border-radius:14px!important;background:var(--bd-bg,var(--ui-surface-0,#0c2830))!important;
  color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;
}
.settingsIconCollectionSection .settingsThemeHeading{margin:0 0 10px!important;}
.settingsIconCollectionSection .settingsThemeHeading h2{margin:0 0 4px!important;}
.settingsIconCollectionSection .settingsThemeHeading p{margin:0!important;max-width:760px!important;color:var(--bd-text-muted,var(--ui-icon-secondary,#c9b99e))!important;font-size:12px!important;line-height:1.35!important;}
.settingsIconCollectionGrid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;min-width:0!important;}
.settingsIconSetChoice{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
  min-width:0!important;min-height:112px!important;height:auto!important;padding:8px!important;gap:5px!important;
  border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;border-radius:11px!important;
  background:var(--bd-panel,var(--ui-surface-1,#102f37))!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;
  box-shadow:none!important;text-align:left!important;white-space:normal!important;line-height:1.2!important;
  cursor:pointer!important;touch-action:manipulation!important;
}
.settingsIconSetChoice:hover{border-color:var(--bd-accent,var(--ui-accent,#c7834a))!important;background:var(--bd-surface,var(--ui-surface-2,#143943))!important;}
.settingsIconSetChoice[aria-pressed="true"]{border-color:var(--bd-accent,var(--ui-accent,#c7834a))!important;background:color-mix(in srgb,var(--bd-accent,#c7834a) 14%,var(--bd-panel,#102f37))!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--bd-accent,#c7834a) 34%,transparent)!important;}
.settingsIconSetChoice:focus-visible{outline:2px solid var(--bd-focus,var(--ui-focus-ring,#d5a653))!important;outline-offset:2px!important;}
.settingsIconSetHead{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important;}
.settingsIconSetNumber{display:grid!important;place-items:center!important;flex:0 0 24px!important;width:24px!important;height:24px!important;border-radius:50%!important;background:var(--bd-accent,var(--ui-accent,#c7834a))!important;color:var(--bd-selection-text,var(--ui-on-accent,#1a1610))!important;font-size:10px!important;font-weight:900!important;}
.settingsIconSetTitle{min-width:0!important;overflow-wrap:anywhere!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;font-size:12px!important;font-weight:800!important;}
.settingsIconSetDescription{display:block!important;min-height:28px!important;color:var(--bd-text-muted,var(--ui-icon-secondary,#c9b99e))!important;font-size:10px!important;line-height:1.25!important;}
.settingsIconSetPreview{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;align-items:center!important;justify-items:center!important;gap:2px!important;min-width:0!important;margin-top:auto!important;padding-top:4px!important;border-top:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;}
.settingsIconSetPreviewItem{display:grid!important;place-items:center!important;width:100%!important;min-width:0!important;aspect-ratio:1!important;}
.settingsIconSetPreviewItem>svg.themeCommandGlyphSvg{display:block!important;width:min(100%,30px)!important;height:auto!important;aspect-ratio:1!important;overflow:visible!important;}
.settingsIconSetPreviewItem>.themeCommandSpriteFrame{width:min(100%,30px)!important;height:auto!important;aspect-ratio:1!important;flex:0 1 30px!important;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .plate,.hudBottom svg.themeCommandGlyphSvg .plate{fill:var(--ui-command-icon-plate);stroke:var(--ui-command-icon-rim);stroke-width:2.4;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .ring,.hudBottom svg.themeCommandGlyphSvg .ring{fill:none;stroke:var(--ui-command-icon-highlight);stroke-width:1.35;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .ink,.hudBottom svg.themeCommandGlyphSvg .ink{fill:var(--ui-command-icon-ink);stroke:var(--ui-command-icon-deep);stroke-width:1.55;stroke-linejoin:round;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .warm,.hudBottom svg.themeCommandGlyphSvg .warm{fill:var(--ui-command-icon-warm);stroke:var(--ui-command-icon-deep);stroke-width:1.4;stroke-linejoin:round;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .cool,.hudBottom svg.themeCommandGlyphSvg .cool{fill:var(--ui-command-icon-cool);stroke:var(--ui-command-icon-deep);stroke-width:1.3;stroke-linejoin:round;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .line,.hudBottom svg.themeCommandGlyphSvg .line{fill:none;stroke:var(--ui-command-icon-ink);stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;}
.settingsIconCollectionSection svg.themeCommandGlyphSvg .dark,.hudBottom svg.themeCommandGlyphSvg .dark{fill:none;stroke:var(--ui-command-icon-deep);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;}
@media(max-width:960px){.settingsIconCollectionGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:430px){
  .settingsIconCollectionSection{padding:8px!important;}
  .settingsIconCollectionGrid{gap:6px!important;}
  .settingsIconSetChoice{min-height:106px!important;padding:6px!important;}
  .settingsIconSetTitle{font-size:11px!important;}
  .settingsIconSetDescription{font-size:9px!important;}
  .settingsIconSetPreviewItem>svg.themeCommandGlyphSvg{width:min(100%,25px)!important;}
  .settingsIconSetPreviewItem>.themeCommandSpriteFrame{width:min(100%,25px)!important;flex-basis:25px!important;}
}

/* Player-selectable artwork themes for command buttons and the three HUD pills. */
.settingsIconThemePicker{display:grid!important;grid-template-columns:minmax(130px,1fr) minmax(180px,2fr)!important;align-items:center!important;gap:7px 12px!important;min-width:0!important;}
.settingsIconThemePicker>label{color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;font-size:12px!important;font-weight:800!important;}
#settingIconThemeSelect{width:100%!important;min-width:0!important;min-height:38px!important;padding:7px 34px 7px 10px!important;border:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;border-radius:9px!important;background:var(--bd-panel,var(--ui-surface-1,#102f37))!important;color:var(--bd-text,var(--ui-on-surface-1,#f3e6cf))!important;font-size:12px!important;font-weight:700!important;}
#settingsIconThemeDescription{grid-column:1/-1!important;margin:0!important;color:var(--bd-text-muted,var(--ui-icon-secondary,#c9b99e))!important;font-size:11px!important;line-height:1.35!important;}
.settingsIconThemePreview{display:grid!important;grid-template-columns:repeat(6,minmax(32px,42px))!important;justify-content:center!important;gap:8px!important;margin-top:10px!important;padding-top:9px!important;border-top:1px solid var(--bd-border-soft,var(--ui-border-subtle,#88795e))!important;}
.settingsIconThemePreviewItem{position:relative!important;display:grid!important;place-items:center!important;width:100%!important;aspect-ratio:1!important;overflow:hidden!important;}
.generatedThemeIconFrame{position:absolute!important;top:0;left:0;display:block!important;width:100%!important;height:100%!important;flex:none!important;margin:0!important;box-sizing:border-box!important;border:0!important;border-radius:0!important;box-shadow:none!important;background-repeat:no-repeat!important;pointer-events:none!important;}
.uiSpriteIcon.uiGeneratedThemeGlyph{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;border:0!important;border-radius:0!important;background:none!important;background-color:transparent!important;-webkit-mask-image:none!important;mask-image:none!important;}
.uiSpriteIcon.uiGeneratedThemeGlyph>.generatedThemeIconFrame{overflow:hidden!important;border:0!important;border-radius:0!important;box-shadow:none!important;}
.hudTop .iconPill .ico.uiGeneratedThemePillIcon{background-repeat:no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;}
@media(max-width:430px){
  .settingsIconThemePicker{grid-template-columns:1fr!important;gap:5px!important;}
  .settingsIconThemePreview{grid-template-columns:repeat(6,minmax(26px,34px))!important;gap:5px!important;}
}
