/* ============================================================
   Live gas system dashboard (/grid/gas)

   Loaded after grid.css, which supplies the title bar, switch, cards,
   rows and attribution. This adds only what gas needs: the headline
   above both views, the entry-point key, greyed zero rows and the
   linepack gauge in the dark card. From design-reference/
   gas-dashboard-design.html, restyled with the site's tokens.
   ============================================================ */

.gas-head { margin-bottom: 28px; }

/* Key under the entry-point bars */
.gas-key {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--heading);
}
.gas-key li { display: inline-flex; align-items: center; gap: 6px; }
.gas-key i { width: 10px; height: 10px; border-radius: 2px; background: var(--src); }

/* A category with no flow: shown, greyed, at the bottom */
.grid-row.gas-idle,
.grid-row.gas-idle b { color: var(--text); font-weight: 400; }

/* ── Linepack gauge (dark card) ── */
.gas-gauge { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.gas-gauge:empty { display: none; }
.gas-gauge-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(250,247,241,0.16);
}
.gas-gauge-span {
  position: absolute;
  top: 0;
  height: 8px;
  border-radius: 4px;
  background: var(--primary-hl);
  opacity: 0.55;
}
.gas-gauge-span.is-falling { background: #F0B35A; }
.gas-gauge-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #B6C9D2;
  font-variant-numeric: tabular-nums;
}

/* Markers: the same shapes on the scale and in the list, so colour is never needed */
.gas-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.gas-gauge-track .gas-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.gas-mark--opening { border: 2px solid #B6C9D2; border-radius: 50%; background: var(--dark); }
.gas-mark--current { border-radius: 50%; background: var(--white); box-shadow: 0 0 0 2px var(--dark); }
.gas-mark--closing { width: 12px; height: 12px; border: 2px solid var(--primary-hl); background: var(--dark); transform: rotate(45deg); }
.gas-gauge-track .gas-mark--closing { transform: translate(-50%, -50%) rotate(45deg); }

/* ── Storage section (below both views) ── */
.gas-storage-sec { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.gas-storage-sec h3 { font-size: 16px; font-weight: 600; color: var(--heading); }
.gas-storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 2fr);
  gap: 24px 16px;
  align-items: start;
}
.gas-st { border-top: 2px solid var(--src); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.gas-st .c { font-size: 14px; color: var(--heading); }
.gas-st .g { font-size: 24px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.gas-st .d { font-size: 13px; color: var(--text); }
.gas-stocks { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.gas-stocks h4 { font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--heading); }
.gas-stocks .grid-row { grid-template-columns: minmax(0, 1fr) auto 6.5em; }
@media (max-width: 860px) {
  .gas-storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gas-stocks { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .gas-stocks { padding: 18px 16px; }
}

/* ── Gas flows diagram (drawn 1040 wide; scrolls inside its card below 680 px) ── */
.gas-flow-scroll svg { min-width: 680px; }
.gas-flow-scroll .nts-node { fill: var(--heading); }
/* "339.10" is wider than "37.02 GW", so the unit sits on its own line in the side card */
.gas-side .grid-side-demand small { display: block; margin-top: 6px; }

.gas-lp-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; }
.gas-lp-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gas-lp-list dt { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #B6C9D2; }
.gas-lp-list dd { margin: 0; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
