/* viewer-extra.css — Demographic Flux-specific viewer chrome.

   Loaded after the shared viewer-chrome.css. Live-statistics badges and the
   period-clock readout are specific to this piece; generic controls live in
   the shared base. Uses --cv-* tokens. */

:root {
  /* Minimum; engine.js raises H to fluxCanvasHeightPx() when strip layout needs more. */
  --cv-flux-canvas-height: 1340px;
  --cv-flux-canvas-min-width: 640px;
  --cv-flux-canvas-default-width: 1080px;
  /* Floor ratio for stacked-mode CLS reservation (viewer-chrome.css aspect-ratio). */
  --cv-canvas-aspect: 640 / 1340;
}

/* Iframe embed: avoid 100vh sidebar clamp and flex overflow cropping the canvas. */
body {
  min-height: auto;
}

.container {
  width: 100%;
  max-width: 100%;
}

.sidebar {
  max-height: none;
}

.canvas-area {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

#canvas-container {
  width: 100%;
  max-width: 100%;
}

.profile-select {
  width: 100%;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--cv-border);
  border-radius: 4px;
  background: var(--cv-bg);
  color: var(--cv-ink);
  font-family: inherit;
}

.control-group label.control-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.control-group .label-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--cv-ink);
}

.control-group .label-sub {
  display: block;
  margin-left: 0;
  font-size: 12.5px;
  font-weight: 400;
  font-style: italic;
  color: var(--cv-secondary);
  line-height: 1.35;
  max-width: 100%;
}

.stat-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--cv-border) 22%, var(--cv-bg));
  border: 1px solid var(--cv-border);
  border-radius: 6px;
}

.stat-badge {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border-radius: 5px;
  padding: 10px 12px;
  border: 1px solid var(--cv-border);
  box-shadow: 0 1px 2px rgba(36, 36, 36, 0.04);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.stat-badge .stat-label {
  font-size: 12px;
  color: var(--cv-secondary);
  line-height: 1.35;
}

.stat-badge .stat-value {
  font-family: "source-code-pro", monospace;
  font-size: 14px;
  font-weight: bold;
  margin-top: 4px;
  color: var(--cv-ink);
  line-height: 1.3;
}

.stat-vitals-row {
  font-weight: bold;
}

.stat-metric-sep {
  color: var(--cv-secondary);
  font-weight: 400;
}

.stat-metric-cbr { color: var(--cv-young); }
.stat-metric-cdr { color: var(--cv-old); }
.stat-metric-cgr { color: var(--cv-green); }

#dividend-badge .stat-value { color: var(--cv-dividend); }

.period-readout {
  font-family: "source-code-pro", monospace;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: var(--cv-bg);
  color: var(--cv-secondary);
  border: 1px solid var(--cv-border);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
}

.period-readout .year-value {
  color: var(--cv-ink);
  font-weight: 600;
}
