/* natgas.css — the LNG pages (/natgas/lng/, /natgas/lng/exports/).
 *
 * site/natgas-lng (2026-11-04, Thomas via HQ): crude's layout. tokens.css
 * declares the palette, app.css builds .panel, .seg, .badge and .data-table,
 * shell.css the sub-bar; this sheet lays the page out: the synthetic
 * banner, the day's figures, the terminals table, one terminal's block under
 * it, and the daily chart. The chart rules restate texas.css's, which lives
 * on another page. No colour literal and no custom property:
 * tests/test_web_tokens.py holds both.
 */

/* THE PAGE GROUND, as texas.css: the body carries no `.app` class. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); margin: 0; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font-ui); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.ng { max-width: 1240px; margin: 0 auto; padding: var(--sp-3) var(--sp-4) var(--sp-5); }
.ng-view[hidden], .ng-detail[hidden], .ng-synth[hidden] { display: none; }
.state { padding: var(--sp-2) var(--sp-3); margin: 0; color: var(--ink-body); font-size: var(--t-data); }

/* SYNTHETIC: above everything, on every view, while the generation is. */
/* Neutral ink, not amber: R3.13 keeps --warn for unhealthy states. */
.ng-synth { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3);
            border: 1px solid var(--line-strong); border-left: 4px solid var(--ink);
            background: var(--surface); color: var(--ink); font-size: var(--t-data); }
.ng-synth strong { font-weight: 600; }

/* ------------------------------------------------------------ the day */
/* Three stats on one grid: eyebrows on one line, figures on one baseline,
 * each unit under its own figure (subgrid rows shared across the three). */
.ng-head { margin: 0 0 var(--sp-3); }
.ng-stats { display: grid; grid-template-columns: repeat(3, max-content);
            grid-template-rows: auto auto auto; gap: 2px var(--sp-5); margin: 0 0 var(--sp-2); }
.ng-stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-items: baseline; }
.ng-stat .num { text-align: left; }
.ng-big { font-family: var(--font-display); font-size: var(--t-title); line-height: 1.15; }
.ng-big.num { font-family: var(--font-data); }
.ng-unit { color: var(--ink-faint); font-size: var(--t-label); }
.ng-missing { margin: 0; color: var(--ink-body); font-size: var(--t-data); }
/* The method note: one quiet paragraph above the first panel. */
.ng-note { max-width: 72ch; margin: 0 0 var(--sp-3); color: var(--ink-body); font-size: var(--t-data); }

/* ------------------------------------------------------------ cards */
.ng .panel { box-shadow: none; margin: 0 0 var(--sp-4); }
.ng .panel-header { flex-wrap: wrap; background: var(--surface); padding: var(--sp-2) var(--sp-3); }
.ng .panel-header h4 { font-size: var(--t-label); font-weight: 600; text-transform: uppercase;
                       letter-spacing: var(--label-tracking); color: var(--ink-body); margin: 0; }
.ng .panel-header #ng-range { margin-left: auto; }
/* The map strip above the headline (HQ, 2026-11-04). */
.ng-mapbox { margin: 0 0 var(--sp-3); }
.ng-mapbox[hidden] { display: none; }
.ng-map { height: 420px; border: 1px solid var(--line); border-radius: var(--r-panel);
          background: var(--bg); overflow: hidden; }
.ng-mapbox .ng-key { display: inline-flex; align-items: center; gap: var(--sp-1); }
.ng-mapbox .ng-key .key-swatch { margin: 0; flex: none; }
.ng-box .panel-body { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ng-table { width: 100%; }
.ng-table td { vertical-align: middle; }
.ng-row { cursor: pointer; }
.ng-row:hover td, .ng-row.is-open td { background: var(--surface-2); }
.ng-name { font-weight: 500; }
.ng-label { margin-left: var(--sp-1); }
.ng-absent { color: var(--ink-faint); }
.ng-flag { color: var(--ink-faint); margin-left: 2px; }
.ng-pipes { color: var(--ink-body); }
.ng-spark-h, .ng-spark-c { width: 104px; }

svg.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.5;
              stroke-linejoin: round; stroke-linecap: round; }

/* Under every figure: its unit, what a gap means, and the attribution.
   .ng-note: a note beside the stats, set as the source lines are but not one
   (a panel's first .ng-src is its source line). */
.ng-src, .ng-note { margin: var(--sp-2) 0 0; color: var(--ink-faint); font-size: var(--t-label); line-height: 1.5; }

/* ------------------------------------------------------------ detail */
.ng-detail { padding: 0 0 var(--sp-1); }
.ng-detail-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3);
                  margin: 0 0 var(--sp-3); }
.ng-detail-head h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-title); margin: 0; }
.ng-meta { color: var(--ink-body); font-size: var(--t-data); }
.ng-detail-head .detail-close { margin-left: auto; }
.ng-gaps { list-style: none; margin: var(--sp-2) 0 0; padding: 0; font-size: var(--t-data); color: var(--ink-body); }
.ng-gaps li { margin: 0 0 2px; }
.ng-gap-k { font-weight: 500; color: var(--ink); }
.ng-gap summary { cursor: pointer; }
.ng-gap-days { display: block; margin: 2px 0 0 var(--sp-3); font-family: var(--font-data); }

/* ------------------------------------------------------------ chart */
.ng-chart { min-height: 190px; }
svg.chart { display: block; width: 100%; height: auto; outline: none; touch-action: pan-y; }
svg.chart:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
svg.chart .tick { fill: var(--ink-faint); font-family: var(--font-data); font-size: var(--t-label); }
svg.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .cross { stroke: var(--line-strong); stroke-width: 1; }
svg.chart .c-t1 { stroke: var(--series-1); }
svg.chart .c-t2 { stroke: var(--series-2); }
svg.chart .c-t3 { stroke: var(--series-3); }
svg.chart .c-t4 { stroke: var(--series-4); }
svg.chart .c-t5 { stroke: var(--series-5); }
svg.chart .dot.c-t1 { fill: var(--series-1); stroke: none; }
svg.chart .dot.c-t2 { fill: var(--series-2); stroke: none; }
svg.chart .dot.c-t3 { fill: var(--series-3); stroke: none; }
svg.chart .dot.c-t4 { fill: var(--series-4); stroke: none; }
svg.chart .dot.c-t5 { fill: var(--series-5); stroke: none; }
svg.chart rect.bar { fill: var(--series-1); stroke: none; }
.ng-readout { margin: var(--sp-1) 0 0; font-family: var(--font-data); font-size: var(--t-label);
              color: var(--ink-body); }

.ng-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: var(--sp-1) 0 0;
             color: var(--ink-body); font-size: var(--t-label); }
.ng-sw { display: inline-block; vertical-align: middle; width: 14px; height: 0; margin-right: var(--sp-1);
         border-top: 2px solid var(--series-1); }
.ng-sw.c-t2 { border-top-color: var(--series-2); }
.ng-sw.c-t3 { border-top-color: var(--series-3); }
.ng-sw.c-t4 { border-top-color: var(--series-4); }
.ng-sw.c-t5 { border-top-color: var(--series-5); }

/* ------------------------------------------------------------ narrow */
/* A phone keeps the figure in view: no sparkline and no day change (the
 * headline carries the total's), and the pipelines move to the terminal's
 * block (its header names them). */
@media (max-width: 640px) {
  .ng-spark-h, .ng-spark-c, .ng-pipes-h, .ng-pipes, .ng-chg { display: none; }
  .ng-table thead th { white-space: normal; }
  /* A long label (a caption from the data) wraps on its own line under the
   * name, so it never widens the column past the figure. */
  .ng-table td:first-child { white-space: normal; }
  .ng-table .ng-label { display: table; margin: 2px 0 0; white-space: normal; }
}
@media (max-width: 560px) {
  .ng-map { height: 300px; }
  .ng-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--sp-2); }
  .ng { padding: var(--sp-2) var(--sp-4) var(--sp-4); }
}
@media (forced-colors: active) {
  svg.chart .line, .spark-line { stroke: CanvasText; }
  svg.chart rect.bar { fill: CanvasText; }
  .ng-sw { border-top-color: CanvasText; }
}

/* THE STANDARD PATTERN (HQ 2026-11-06): a stat row and one source line, as
   on the map pages' panels. */
.ng-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2) var(--sp-4);
  margin: var(--sp-2) 0 var(--sp-3);
}
.ng-stat { display: flex; flex-direction: column; min-width: 0; }
.ng-stat-label {
  font-size: var(--t-label);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ng-stat-value { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* A source line is never cut (HQ 2026-11-12, gas B; stage (a)'s a8): it wraps,
   whole, at every width. It used to be one line with an ellipsis, which hid
   the PUDL credit Thomas's yes requires in full. */
.ng-source {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ quiet pages */
/* Thomas via HQ, 2026-11-06: "remove words, make it look clean" -- data-
 * dense and quiet, numbers first. A headline row, then the map, then a table
 * with no box: muted headers, light rules, tabular figures. */
.ng-hero { margin: 0 0 var(--sp-3); }
.ng-hero[hidden] { display: none; }
.ng-hero-k { display: block; color: var(--ink-faint); font-size: var(--t-label);
             text-transform: uppercase; letter-spacing: var(--label-tracking); }
.ng-hero-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); }
.ng-hero-num { font-family: var(--font-data); font-size: var(--t-display); line-height: 1.2;
               color: var(--ink); font-variant-numeric: tabular-nums; text-align: left; }
.ng-hero-unit { color: var(--ink-body); font-size: var(--t-data); }
.ng-hero-chg { color: var(--ink-body); font-size: var(--t-data); }
.ng-hero-chg .num { font-family: var(--font-data); }
.ng-hero-note { color: var(--ink-body); font-size: var(--t-data); }
.ng-hero-asof { margin-left: auto; color: var(--ink-faint); font-size: var(--t-label); }

.ng-view > .panel.ng-box { border: 0; background: transparent; }
.ng-view > .panel.ng-box > .panel-header { background: transparent; padding: 0 0 var(--sp-1); border: 0; }
.ng-view > .panel.ng-box > .panel-body { padding: 0; }
.ng-table thead th { position: static; background: transparent; border-bottom: 1px solid var(--line-strong);
                     font-family: var(--font-ui); text-transform: none; letter-spacing: 0;
                     color: var(--ink-faint); text-align: right; vertical-align: bottom; }
.ng-table thead th:first-child { text-align: left; }
.ng-table td:first-child { font-family: var(--font-ui); }
.ng-table .ng-pipes, .ng-table .ng-pipes-h { text-align: left; padding-left: var(--sp-4);
                                             font-family: var(--font-ui); color: var(--ink-faint); }
.ng-table .ng-spark-h { text-align: center; }
.ng-th-unit { display: block; font-weight: 400; font-size: var(--t-label); color: var(--ink-faint); }
.ng-chip { display: inline-block; margin-left: var(--sp-2); padding: 0 6px; border: 1px solid var(--line);
           border-radius: var(--r-pill); font-family: var(--font-ui); font-size: var(--t-label);
           color: var(--ink-faint); line-height: 1.5; cursor: help; white-space: nowrap; }
.ng-chip-more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#ng-map-noroute { margin-top: var(--sp-1); }
@media (max-width: 560px) {
  .ng-hero-asof { margin-left: 0; flex-basis: 100%; }
}
.ng-chip.is-open .ng-chip-more { position: static; width: auto; height: auto; overflow: visible;
                                 clip: auto; white-space: normal; }

/* ------------------------------------------------------------ the work area */
/* Thomas via HQ, 2026-11-17, after the mock: "One list + switch"; the map
 * "Beside the list"; exports "Full width, small change". One pattern on the
 * three gas pages: a dense list on the left, the map and the opened item on
 * the right. The side column is FIRST in the source (the map, the key, the
 * block, then the lists: the order a reader without this sheet gets, and the
 * order tests/test_natgas_map.py pins) and is placed second here.
 * js/natgas_layout.js works the two switches and, on a narrow screen, puts
 * the block under its own row. */
.ngw { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
/* The terminals' table has six columns: a wider list. */
.ngw.ngw-feed { grid-template-columns: minmax(0, 620px) minmax(0, 1fr); }
.ngw > .ngw-list { grid-column: 1; grid-row: 1; min-width: 0; }
.ngw > .ngw-side { grid-column: 2; grid-row: 1; min-width: 0; display: grid; gap: var(--sp-2);
                   grid-template-columns: minmax(0, 1fr); }
.ngw-tabs { display: none; }
.ngw-tabs[hidden] { display: none; }
.ngw-list { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.ngw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2);
           border-bottom: 1px solid var(--line); }
.ngw-views { flex-wrap: wrap; }
.ngw-views .seg-btn { white-space: nowrap; font-size: var(--t-label); }
.ngw-n { margin-left: var(--sp-1); color: var(--ink-faint); font-family: var(--font-data); }
.ngw-n:empty { display: none; }
.ngw-q { flex: 1 1 7rem; min-width: 0; padding: 2px var(--sp-2); border: 1px solid var(--line-strong);
         border-radius: var(--r-ctl); background: var(--surface); color: var(--ink);
         font-family: var(--font-ui); font-size: var(--t-label); }
.ngw-none { margin: 0; padding: var(--sp-2); color: var(--ink-body); font-size: var(--t-data); }
.ngw-none[hidden] { display: none; }
/* The list scrolls in its own frame, as tall as the map beside it. */
.ngw-scroll { max-height: clamp(420px, calc(100vh - 230px), 640px); overflow: auto; }
/* One list on show; the switch says its name, so its heading is read out only. */
.ngw-scroll > .ng-box:not(.is-view) { display: none; }
.ngw-scroll > .ng-box > .panel-header { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
                                        clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ngw-list .panel.ng-box { border: 0; background: transparent; box-shadow: none; margin: 0; }
.ngw-list .panel.ng-box > .panel-body { padding: 0; }
.ngw-list .ng-view > .panel.ng-box > .panel-header { padding: var(--sp-2) var(--sp-2) var(--sp-1); }
/* Dense rows: a name beside its figures. */
.ngw-list .ng-table th, .ngw-list .ng-table td { padding: 3px 6px; }
.ngw-list .ng-table td:first-child { white-space: normal; }
/* A terminal's pipelines wrap in their cell: on one line they ran past the list's frame. */
.ngw-list .ng-table .ng-pipes, .ngw-list .ng-table .ng-pipes-h { white-space: normal; padding-left: var(--sp-2); }
.ngw-list .ng-src { margin: 0; padding: var(--sp-1) var(--sp-2); border-top: 1px solid var(--line); }
.ngw-list .ng-row.is-open > td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
/* The opened item, under the map: its name line, its figures in one row, its
 * chart at the column's width, one source line. */
.ngw-side .ng-mapbox { margin: 0; }
/* (Its ground restated: a class placed from another component says what it keeps, test_web_tokens.) */
.ngw-side .ng-map { height: 260px; background: var(--bg); }
.ngw .ng-detail { margin: 0; padding: 0; min-width: 0; }
.ngw .ng-detail-head { margin: 0 0 var(--sp-1); }
.ngw .ng-detail .ng-stats { margin: 0 0 var(--sp-2); padding: var(--sp-1) 0; gap: var(--sp-1) var(--sp-4);
                            border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ngw .ng-detail .panel { margin: 0; }
.ngw .ng-detail .ng-box .panel-body { padding: var(--sp-2); }
/* A narrow screen's opened row: the block in a row of its own under it. */
tr.ngw-under > td { padding: var(--sp-2) 0 var(--sp-3); white-space: normal; text-align: left;
                    background: var(--surface); font-family: var(--font-ui); }
/* EXPORTS keeps its table the full width (twelve monthly columns): the map,
 * and the opened terminal beside it, above the table. */
.ngw.ngw-wide { grid-template-columns: minmax(0, 1fr); }
.ngw-wide > .ngw-side { grid-column: 1; grid-row: 1; }
.ngw-wide > .ngw-list { grid-column: 1; grid-row: 2; border: 0; background: transparent; }
.ngw-wide .ng-map { height: 300px; background: var(--bg); }
@media (min-width: 1001px) {
  .ngw-wide > .ngw-side:has(> .ng-detail:not([hidden])) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  /* The list's head stays while its rows scroll (the frame is .ngw-scroll,
   * so the tables' own sideways frame steps aside). */
  .ngw-scroll .scroll { overflow: visible; }
  .ngw-scroll .ng-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
}
/* ONE COLUMN, and a List | Map switch with the list first (as on the Texas
 * page). The map keeps its size while the list is on show: it is folded away,
 * not removed, so it never measures a box of nothing. */
@media (max-width: 1000px) {
  .ngw { display: block; }
  .ngw-tabs { display: flex; margin: 0 0 var(--sp-2); }
  .ngw-tabs .seg-btn { flex: 1 1 0; padding: var(--sp-1) var(--sp-2); }
  .ngw > .ngw-side { margin: 0 0 var(--sp-2); }
  .ngw.is-tab-list:not(.ngw-wide) > .ngw-side { height: 0; margin: 0; overflow: hidden; visibility: hidden; }
  .ngw.is-tab-map:not(.ngw-wide) > .ngw-list { display: none; }
  .ngw-scroll { max-height: none; overflow: visible; }
  .ngw-list > .ng-detail { padding: var(--sp-2); border-bottom: 1px solid var(--line); }
  .ngw-side .ng-map { height: 300px; background: var(--bg); }
}
