/* FM27 V10.86 R27.19 – scoped UI-only Nachfix auf dem installierten R27.18. */
/* Stadium structure and 4/5 : 1/5 grid remain unchanged. Keep every fact
   in one horizontal dt/dd row; the right values align at the right edge. */
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts > div,
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts > div.fm27-r2715-quality {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,auto) !important;
  align-items: center !important;
  column-gap: 6px !important;
  row-gap: 4px !important;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts > div:not(.fm27-r2715-quality) {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts dt {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts dd {
  display: flex !important;
  justify-self: end !important;
  justify-content: flex-end !important;
  align-items: center !important;
  text-align: right !important;
  min-width: 0;
  margin: 0 !important;
}
/* Same two fixed columns on each quality row: 5 pips + an action/status.
   Compact sizes prevent the narrow sidebar from overflowing at desktop widths. */
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts .fm27-r2715-quality dd {
  display: grid !important;
  grid-template-columns: 48px 72px !important;
  justify-content: end !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 125px;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts .fm27-r2715-quality .fm27-s74-rating {
  display: grid !important;
  grid-template-columns: repeat(5, 8px) !important;
  gap: 2px !important;
  align-items: center !important;
  justify-items: center !important;
  width: 48px;
  white-space: nowrap;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts .fm27-r2715-quality .fm27-s74-rating i {
  width: 8px !important;
  height: 8px !important;
}
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts .fm27-r2715-quality .fm27-r2716-upgrade,
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts .fm27-r2715-quality .fm27-r2716-max {
  box-sizing: border-box;
  display: inline-flex !important;
  width: 72px !important;
  min-height: 25px;
  padding: 2px 0 !important;
  margin: 0 !important;
  align-items: center !important;
  justify-content: flex-end !important;
  text-align: right !important;
  white-space: nowrap;
  font-size: .7rem !important;
  line-height: 1.2 !important;
}
/* Retain single-row name/capacity information even at narrow widths.
   Very long stadium names may wrap inside their right-aligned value cell. */
body.fm27-midnight .fm27-r2715-stadium .fm27-r2715-facts > div:not(.fm27-r2715-quality) dd {
  max-width: 100%;
  overflow-wrap: anywhere;
}
