/* Panneaux : registre d'énergie et graphiques (colonne du milieu), boutons et curseurs (colonne de droite). */
.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.label {
  font: 500 11px var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 12px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ledger .v {
  text-align: right;
  min-width: 9ch;
}
.bar {
  height: 8px;
  background: var(--line);
  position: relative;
}
.bar i {
  position: absolute;
  top: 0;
  bottom: 0;
}
.ledger .sum {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.k {
  color: var(--kin);
}
.u {
  color: var(--pot);
}
.e {
  color: var(--em);
}
.r {
  color: var(--rad);
}
.x {
  color: var(--exp);
}
.n {
  color: var(--nuc);
}
.nu {
  color: var(--nu);
}
.o {
  color: var(--order);
}
.chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart canvas {
  width: 100%;
  height: 150px;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font: 12px var(--f-mono);
  color: var(--muted);
}
.legend b {
  display: inline-block;
  width: 10px;
  height: 2px;
  vertical-align: middle;
  margin-right: 5px;
}
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
button {
  font: 500 13px var(--f-body);
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
}
button:hover {
  border-color: var(--muted);
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--kin);
  outline-offset: 2px;
}
button.primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  font-size: 13px;
}
.slider span:last-of-type {
  font-family: var(--f-mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.slider input {
  grid-column: 1/-1;
  width: 100%;
  accent-color: var(--kin);
}
/* Choice of the panel below the buttons: sliders or composition (a two-segment radio group) */
.tabs {
  display: flex;
  border: 1px solid var(--line);
}
.tabs label {
  flex: 1;
  cursor: pointer;
}
.tabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tabs span {
  display: block;
  padding: 6px 10px;
  text-align: center;
  font: 500 13px var(--f-body);
  color: var(--muted);
}
.tabs input:checked + span {
  background: var(--fg);
  color: var(--bg);
}
.tabs input:focus-visible + span {
  outline: 2px solid var(--kin);
  outline-offset: -2px;
}
.sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[hidden] {
  display: none !important;
}
/* Composition table: one row per species; species absent from the box are dimmed */
.compo table {
  width: 100%;
  border-collapse: collapse;
  font: 12px var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.compo th {
  font: 500 11px var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 6px 6px 0;
  border-bottom: 1px solid var(--line);
}
.compo td {
  padding: 3px 6px 3px 0;
}
.compo .num {
  text-align: right;
}
.compo td i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
}
.compo .name {
  color: var(--muted);
}
.compo tr.zero {
  opacity: 0.35;
}
.compo-note {
  margin: 8px 0 0;
  font: 12px var(--f-mono);
  color: var(--muted);
}
/* Medium screens: the controls span the full width below, sliders in two columns */
@media (max-width: 1180px) and (min-width: 821px) {
  .sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
  }
}
