/* Shared fullscreen button + box fullscreen (js/box-fullscreen.js).
   One square button on every page, light and dark; the colour follows the
   header it sits on. */
.nm-fs-btn,
button.nm-fs-btn,
.card-full .card-header .btn.nm-fs-btn,
html[data-mode] .card-full .card-header .btn.nm-fs-btn {
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  border-radius: 8px !important;
  border-width: 1px !important;
  border-style: solid !important;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.nm-fs-btn:focus-visible { outline: 2px solid var(--B5, #3D6CB8); outline-offset: 2px; }

/* a box never grows to its chart's width: after leaving fullscreen the chart
   still has the fullscreen width for a moment, and a grid/flex track sized by
   content would keep it (the CPI cards spread over the whole row) */
.nm-fs-box { min-width: 0; }
.nm-fs-box .highcharts-container { max-width: 100%; }

/* the box in fullscreen: whole box, page background, chart takes the rest */
.nm-fs-box:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 18px 22px !important;
  box-sizing: border-box !important;
  background: #f4f6f9;
}
html[data-mode="dark"] .nm-fs-box:fullscreen { background: #1a1d21; }
.nm-fs-box:fullscreen > * { flex-shrink: 0; }
.nm-fs-box:fullscreen .nm-fs-fill {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
}
.nm-fs-box:fullscreen::backdrop { background: #f4f6f9; }
html[data-mode="dark"] .nm-fs-box:fullscreen::backdrop { background: #1a1d21; }

/* ── Phones / tablets: CSS fullscreen, landscape ──────────────────────────
   The box covers the viewport; on a portrait screen (no orientation lock)
   it is turned 90° so charts get the long side. */
html.nm-fs-lock, html.nm-fs-lock body { overflow: hidden !important; }
.nm-fs-pseudo {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: auto !important; bottom: auto !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  max-width: none !important; max-height: none !important; min-height: 0 !important;
  margin: 0 !important; border-radius: 0 !important;
  z-index: 2147483000 !important;
  display: flex !important; flex-direction: column !important;
  overflow: hidden !important;
  padding: 10px 14px !important; box-sizing: border-box !important;
  background: #f4f6f9 !important;
  transform: none;
}
html[data-mode="dark"] .nm-fs-pseudo { background: #1a1d21 !important; }
.nm-fs-pseudo.nm-fs-rotate {
  width: 100vh !important; width: 100dvh !important;
  height: 100vw !important;
  transform: rotate(90deg) translateY(-100%) !important;
  transform-origin: top left !important;
}
.nm-fs-pseudo > * { flex-shrink: 0; }
/* what fills the free height: the bound fill element, or the usual chart
   areas of the landing cards / expectations boxes */
.nm-fs-pseudo .nm-fs-fill,
.nm-fs-pseudo > .card-body,
.nm-fs-pseudo > .box-chart {
  flex: 1 1 auto !important; min-height: 0 !important;
  height: auto !important; max-height: none !important; width: 100% !important;
}
.nm-fs-pseudo .chart-container { height: 100% !important; }
