/* Back belongs to screens; close belongs to dialogs and pop-up panels. */
:is(#simulation, #sim-dialog, #cinema, .research-moment) :is(.nav-back, .nav-close) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  margin: var(--nav-control-margin, 0);
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--fg);
  cursor: pointer;
  pointer-events: auto;
}
:is(#simulation, #sim-dialog, #cinema, .research-moment) :is(.nav-back, .nav-close):hover { background: #ffffff0d; }
:is(#simulation, #sim-dialog, #cinema, .research-moment) :is(.nav-back, .nav-close):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:is(#simulation, #sim-dialog, #cinema, .research-moment) :is(.nav-back, .nav-close):disabled { opacity: .4; cursor: wait; }
:is(.nav-back, .nav-close) svg { display: block; width: 24px; height: 24px; flex: none; }
.screen-close { position: absolute; top: 18px; right: 18px; z-index: 8; }
.screen-navigation { position: absolute; top: 18px; left: 18px; z-index: 8; }
.research-workspace .view-title { left: 80px; }
.ending-workspace .ending-view { padding-top: 72px; }
.city-heading > .nav-back { --nav-control-margin: 0 0 0 -10px; }
.work-expansion > header { align-items: center; }
.production-detail-heading { grid-template-columns: 1fr auto; }
.production-detail-heading > .nav-close { grid-column: 2; grid-row: 1 / 3; --nav-control-margin: -8px -8px 0 0; }
.dialog-navigation { position: sticky; top: 0; z-index: 3; height: 0; display: flex; justify-content: flex-end; margin-right: -20px; }
.dialog-navigation > .nav-close { transform: translateY(-20px); }
#sim-dialog > h2 { padding-right: 28px; }
.ending-banner > .nav-close, .discovery-content > .nav-close { position: absolute; top: 12px; right: 12px; z-index: 5; }
.ending-banner .outcome-audio { right: 68px; }
.discovery-content { position: relative; }
.discovery-content > .nav-close { top: -12px; right: -12px; }
.showing-discovery .workspace .nav-back,
.strategy-game:has(.ending-banner) .workspace .nav-back { visibility: hidden; }

/* A quiet, discoverable entry beside the world's research control. */
.world-tree-controls .wiki-link {
  display: inline-flex;
  align-items: flex-start;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: var(--text-meta);
  line-height: 1.5;
  letter-spacing: 1px;
  white-space: nowrap;
}
.world-tree-controls .wiki-link:hover { color: var(--fg); }
