/* Chart pages of the Fission or Fiction project: heading, controls, readouts and the figure. */
:root { color-scheme: light; background: #faf9f6; color: #252525; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; }
.chart-page { font: 14px/1.5 "Courier New", Courier, monospace; padding: 18px; }
a { color: #173fbe; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid #173fbe; outline-offset: 3px; }
.chart-heading { max-width: 1400px; margin: 0 auto 10px; }
.chart-heading a { font-size: 12px; }
h1 { margin: 12px 0; font-size: clamp(18px, 3vw, 24px); line-height: 1.3; }
.chart-shell { display: flex; flex-direction: column; width: 100%; max-width: 1400px; margin: auto; height: max(560px, calc(100svh - 155px)); }
#chart { flex: 1 1 auto; min-height: 0; width: 100%; }
.chart-source { max-width: 1400px; margin: 12px auto 0; font-size: 11px; color: #65635d; }
#chart-status { padding: 12px; }
.embedded .chart-page { padding: 0; }
.embedded .chart-heading, .embedded .chart-source { display: none; }
.embedded .chart-shell { height: 100vh; max-width: none; }
/* The world map sets its own height from the width (charts.mjs). */
[data-chart="evolution"] .chart-shell { height: auto; }
[data-chart="evolution"] #chart { flex: none; }

.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 8px; font-size: 13px; }
.chart-controls:empty, .chart-readouts:empty { display: none; }
.chart-controls fieldset { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; border: 0; }
.chart-controls legend { float: left; margin-right: 10px; color: #65635d; }
.chart-controls label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.chart-controls input { margin: 0; accent-color: #456674; }
.chart-controls input[type="range"] { width: 220px; }
.chart-controls button { font: inherit; padding: 3px 12px; border: 1px solid #bebbb3; background: #faf9f6; color: #252525; cursor: pointer; }
.chart-controls button:hover { background: #efede7; }
.chart-controls button:focus-visible, .chart-controls input:focus-visible { outline: 2px solid #173fbe; outline-offset: 2px; }
.chart-controls output { font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
#pattern-key { display: inline-flex; align-items: center; gap: 6px; color: #65635d; }
.cross { display: inline-block; width: 16px; height: 12px; background:
  linear-gradient(45deg, transparent 42%, #faf9f6 42% 58%, transparent 58%) 0 0 / 6px 6px,
  linear-gradient(-45deg, transparent 42%, #faf9f6 42% 58%, transparent 58%) 0 0 / 6px 6px, #8d8a82; }

.chart-readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px 14px; margin-bottom: 6px; padding: 8px 0; border-block: 1px dotted #c9c6be; }
.chart-readouts span { display: block; font-size: 11px; color: #65635d; }
.chart-readouts output { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }

/* Leaflet map: tooltips and popups in the page font. */
.leaflet-container { font: 13px/1.45 "Courier New", Courier, monospace; background: #e8e6e0; }
.leaflet-popup-content { margin: 10px 12px; max-height: min(340px, 60vh); overflow-y: auto; font: 12px/1.45 "Courier New", Courier, monospace; }
.leaflet-popup-content h2 { margin: 0 0 4px; font-size: 13px; }
.leaflet-popup-content ul { margin: 8px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px dotted #c9c6be; }
.leaflet-popup-content li { margin: 0 0 9px; padding-left: 14px; position: relative; color: #45433e; }
.leaflet-popup-content li b { color: #252525; }
.leaflet-popup-content li .swatch { position: absolute; left: 0; top: 4px; width: 8px; height: 8px; }
.leaflet-popup-content small { color: #65635d; }
.leaflet-tooltip { font: 12px/1.4 "Courier New", Courier, monospace; }
.site-marker svg { display: block; overflow: visible; }

/* Details of a clicked reactor in the commissioning chart. */
.chart-shell { position: relative; }
.detail-card { position: absolute; z-index: 5; top: 44px; right: 10px; width: min(330px, calc(100% - 20px)); padding: 10px 30px 10px 12px;
  background: #faf9f6; border: 1px solid #bebbb3; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); font-size: 12px; line-height: 1.45; color: #45433e; }
.detail-card[hidden] { display: none; }
.detail-card h2 { margin: 0 0 2px; font-size: 13px; color: #252525; }
.detail-card small { color: #65635d; }
.detail-card p { margin: 6px 0 0; }
.detail-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; font: 18px/1 "Courier New", Courier, monospace; color: #65635d; cursor: pointer; padding: 2px 4px; }
.detail-close:hover, .detail-close:focus-visible { color: #252525; }

@media (max-width: 560px) {
  .chart-page { padding: 12px 5px; }
  .chart-heading, .chart-source { padding: 0 7px; }
  .chart-controls input[type="range"] { width: 150px; }
}
