/* INJ Workspace · centering and readability for single-value widgets.
   Chart, order book, heatmap and multi-metric layouts remain untouched. */

/* Preserve the center on standard cards, resized tiles and fullscreen mode.
   Fullscreen previously applied justify-content:flex-start to every section. */
html[data-inj-page="workspace"] body .ws-card > .ws-card-body.ws-single-metric,
html[data-inj-page="workspace"] body .ws-preview > .ws-card-body.ws-single-metric,
html[data-inj-page="workspace"] body.ws-immersive .ws-card > .ws-card-body.ws-single-metric {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center !important;
  width: 100%;
  min-width: 0;
  min-height: 0;
  text-align: center;
  gap: clamp(4px, 1.5cqh, 12px);
  padding: clamp(6px, 1.8cqh, 16px) clamp(8px, 1.8cqw, 20px);
  overflow-x: hidden;
  overflow-y: auto;
}

/* The main number must occupy the visual centre rather than the top edge. */
html[data-inj-page="workspace"] body .ws-card-body.ws-single-metric > .ws-section-row {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 4px;
  border-bottom: 0;
  text-align: center;
}

html[data-inj-page="workspace"] body .ws-card .ws-card-body.ws-single-metric > .ws-section-row > .ws-section-value {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(16px, min(8cqw, 22cqh), 56px) !important;
  font-weight: 700;
  line-height: 1.08 !important;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  text-align: center !important;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-inj-page="workspace"] body .ws-preview .ws-card-body.ws-single-metric > .ws-section-row > .ws-section-value {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: clamp(18px, 4vw, 30px) !important;
  line-height: 1.1 !important;
  text-align: center !important;
  overflow-wrap: anywhere;
}

/* Secondary readings stay directly underneath and do not pull the metric aside. */
html[data-inj-page="workspace"] body .ws-card-body.ws-single-metric > :is(.ws-section-note, .ws-chart-timeframe, .ws-data-status),
html[data-inj-page="workspace"] body .ws-card-body.ws-single-metric .ws-section-label {
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  text-align: center !important;
  overflow-wrap: anywhere;
}

/* Other genuinely single-value cards use the existing body class; avoid
   changing price arrows and complex section/widget bodies. */
html[data-inj-page="workspace"] body .ws-card > .ws-card-body.ws-center-value,
html[data-inj-page="workspace"] body.ws-immersive .ws-card > .ws-card-body.ws-center-value {
  align-items: center;
  justify-content: center !important;
  text-align: center;
}
