/* ═══ Assessment — tabs ═══════════════════════════════════════════
   Price History and Gas Flow tabs.

   Part 5 of 9 of what was one 3,418-line static/css/pages/assessment.css
   (audit C3). LOAD ORDER IS LOAD-BEARING -- for CSS the cascade IS the
   behaviour, so two rules of equal specificity are decided by which came
   last. templates/base.html links them in exactly this sequence:

     shell -> panels -> tree -> overview -> tabs -> routes -> mobile -> region -> demand

   Moving a rule between these files, or reordering the links, can change
   rendering even though nothing was edited. tests/test_css_split.py holds
   the order and the byte content.
   ═══════════════════════════════════════════════════════════════ */

/* ── Price History tab — a report page (PPT-style, like the Overview
   right rail): no bordered filter-cards. Markets rail on the left as a
   written list with hairline rhythm, two stacked charts on the right,
   accent-bar section titles, readable sans type. ──────────────────── */
/* host div must carry the height (same trick as #aoiOverviewContent) for
   the % chain panel → page → layout to resolve */
#aoiPriceHistoryContent { height: 100%; }
@media (max-width: 1180px) { #aoiPriceHistoryContent { height: auto; } }
.ph-page { height: 100%; padding: var(--aoi-tab-pad); }
.ph-layout {
  display:               grid;
  grid-template-columns: minmax(340px, 3fr) minmax(0, 7fr);
  /* one definite row — otherwise the (long) markets rail content-sizes the
     row and the whole page scrolls instead of the rail scrolling itself */
  grid-template-rows:    minmax(0, 1fr);
  align-items:           stretch;
  height:                100%;
  min-height:            0;
}
/* Markets rail scrolls its own list; charts column fills the page height.
   The column divider is the charts column's left rule (no grid gap — the
   two paddings around the rule make up the gutter). */
.ph-rail {
  min-height: 0;
  overflow-y: auto;
  padding-right: 26px;
}
.ph-charts {
  display:        flex;
  flex-direction: column;
  min-height:     0;
  border-left:    1px solid var(--bdr);
  padding-left:   34px;
}
@media (max-width: 1180px) {
  .ph-page   { height: auto; }
  .ph-layout { grid-template-columns: 1fr; height: auto; row-gap: 30px; }
  .ph-rail   { overflow-y: visible; padding-right: 0; }
  .ph-charts { border-left: none; padding-left: 0; }
}

/* Markets rail — one report block per hub, hairline separated */
.ph-mkts {
  display:        flex;
  flex-direction: column;
}
.ph-mkt { padding: var(--space-xl) 0 var(--space-xl); }
.ph-mkt + .ph-mkt { border-top: 1px solid var(--bdr); }
.ph-mkt-head {
  display:     flex;
  align-items: center;
  gap:         var(--space-lg);
  width:       100%;
  padding:     0;
  border:      none;
  background:  none;
  text-align:  left;
  cursor:      pointer;
  font-family: var(--font-sans);
}
.ph-mkt .ph-dot {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--ph-c);
  opacity:       .3;
  flex:          none;
  transition:    opacity .12s, box-shadow .12s;
}
.ph-mkt.ph-on .ph-dot {
  opacity:    1;
  box-shadow: 0 0 6px color-mix(in srgb, var(--ph-c) 60%, transparent);
}
.ph-mkt-name {
  font-size:   clamp(12px, 0.47vw + 3px, 15px);   /* 1920→12, ≥2560→15 (report ramp) */
  font-weight: 700;
  color:       var(--t2);
  transition:  color .12s;
}
.ph-mkt.ph-on .ph-mkt-name { color: var(--t0); }
.ph-mkt-meta {
  margin-left: auto;
  font-size:   var(--fs-caption);
  color:       var(--t2);
}
.ph-mkt-sub {
  font-family: var(--font-sans);
  font-size:   var(--fs-micro);
  color:       var(--t2);
  white-space: nowrap;
}
.ph-mkt-pipes {
  list-style: none;
  margin:     var(--space-md) 0 0;
  padding:    0 0 0 20px;
}
.ph-pipe-row {
  display:               grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap:            14px;
  align-items:           baseline;
  padding:               var(--space-sm) 0;
  font-family:           var(--font-sans);
  font-size:             var(--fs-sm);
  color:                 var(--t1);
}
.ph-pipe-row + .ph-pipe-row { border-top: 1px solid color-mix(in srgb, var(--bdr) 45%, transparent); }
.ph-pipe-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-pipe-op   { color: var(--t2); font-size: var(--fs-caption); text-align: right; }
/* Via-chain annotation — how an unwired crossing line reaches this market
   ("via <gathering> · tie-in 1.2 km" / "· interconnect"). Full-width second
   line under the name/operator pair. */
.ph-pipe-via {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size:   var(--fs-xs);
  color:       var(--t2);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}
/* Market-head "via" chip — the acreage itself is crossed only by unwired
   line(s); this market comes from the connection chase. Amber = tract color. */
.ph-via-badge {
  flex-shrink:    0;
  font-family:    var(--font-badge);
  font-size:      var(--fs-3xs);
  font-weight:    700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding:        var(--space-2xs) var(--space-xs);
  border-radius:  var(--radius);
  color:          #8a6410;
  background:     color-mix(in srgb, #f2c94c 30%, transparent);
  border:         1px solid color-mix(in srgb, #c9971c 45%, transparent);
}

/* Stacked charts column */
.ph-charts-head {
  display:       flex;
  align-items:   center;
  gap:           18px;
  margin-bottom: var(--space-xs);
}
.ph-charts-head .aoi-rpt-sec-title { margin: 0; }
/* Exhibit-style header (vs the rail's accent-bar section title): ring
   marker + title, then a thin accent rule running out to the TF buttons. */
.ph-exhibit-title::before {
  width:         13px;
  height:        13px;
  border:        4px solid var(--acc);
  border-radius: 50%;
  background:    transparent;
}
.ph-exhibit-rule {
  flex:          1;
  height:        3px;
  border-radius: 2px;
  background:    var(--acc);
  opacity:       .9;
}
/* Each chart section takes half of the remaining column height; the wrap
   is the Chart.js sizing box (responsive + maintainAspectRatio:false).
   Left padding = exhibit ring (13px) + head gap (18px) so the chart block
   left-aligns with the "P" of the PRICE HISTORY title. */
.ph-chart-sec {
  flex:           1;
  display:        flex;
  flex-direction: column;
  min-height:     215px;   /* short viewports: keep readable, page scrolls */
  /* right pad 34px ≈ lines the chart's right edge up with the middle of the
     ALL timeframe button in the exhibit header */
  padding:        14px 34px 0 31px;
}
.ph-chart-sec + .ph-chart-sec { padding-top: 34px; }
.ph-chart-title {
  font-family:    var(--font-sans);
  font-size:      var(--rpt-lg, 16px);
  font-weight:    600;
  color:          var(--t0);
  padding-bottom: var(--space-md);
  border-bottom:  1px solid color-mix(in srgb, var(--bdr) 60%, transparent);
}
.ph-chart-title span { font-weight: 400; font-size: var(--fs-caption); color: var(--t2); margin-left: var(--space-md); }
.ph-chart-wrap {
  position:   relative;
  flex:       1;
  min-height: 0;
  padding:    var(--space-lg) 0 0;
}
@media (max-width: 1180px) {
  .ph-chart-wrap { height: 260px; flex: none; }
}

/* Report footnote (shared by rail + charts column) */
.ph-note {
  margin-top:  var(--space-2xl);
  font-family: var(--font-sans);
  font-size:   var(--fs-body);
  line-height: 1.6;
  color:       var(--t2);
}
.ph-charts > .ph-note { margin-left: 31px; }   /* align with the chart blocks */

/* ══ Gas Flow tab — operator takeaway comparison ═══════════════════ */
.gf-title-sub {
  margin-left:    var(--space-2xs);
  font-size:      var(--rpt-s, 12px);
  font-weight:    500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color:          var(--t2);
}
.gf-picker-hint {
  align-self:  center;
  margin-left: auto;
  font-family: var(--font-sans);
  font-size:   var(--fs-xs);
  color:       var(--t2);
  opacity:     .7;
}

/* operator picker chips */
.gf-picker { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: 14px; }
.gf-chip {
  display:       inline-flex;
  align-items:   center;
  gap:           var(--space-sm);
  padding:       var(--space-xs) var(--space-lg);
  border:        1px solid var(--bdr);
  border-radius: 999px;
  background:    var(--bg1);
  color:         var(--t2);
  font-family:   var(--font-sans);
  font-size:     var(--fs-micro);
  cursor:        pointer;
  transition:    border-color .15s, color .15s, background .15s;
}
.gf-chip:hover { border-color: var(--bdr2); color: var(--t1); }
.gf-chip.on    { background: var(--bg2); font-weight: 600; }
.gf-chip .gf-plus { font-weight: 600; opacity: .6; }
.gf-sw {
  width:         10px;
  height:        10px;
  border-radius: 3px;
  flex:          none;
  display:       inline-block;
}

/* comparison columns */
.gf-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xl); }
.gf-cols-1 { grid-template-columns: minmax(0, 1fr); }
.gf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1180px) { .gf-cols { grid-template-columns: 1fr; } }
.gf-col {
  background:    var(--bg1);
  border:        1px solid var(--bdr);
  border-radius: var(--radius);
  overflow:      hidden;
  display:       flex;
  flex-direction: column;
}
.gf-col-ghost {
  align-items:     center;
  justify-content: center;
  min-height:      220px;
  border-style:    dashed;
  background:      transparent;
  color:           var(--t2);
  font-size:       var(--fs-caption);
  padding:         20px;
  text-align:      center;
}
.gf-col-head {
  display:     flex;
  align-items: center;
  gap:         var(--space-md);
  padding:     var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--bdr);
  min-width:   0;
}
.gf-col-name {
  font-size:     var(--fs-sm);
  font-weight:   600;
  color:         var(--t1);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  min-width:     0;
}
.gf-col-sub {
  margin-left: auto;
  flex:        none;
  font-family: var(--font-sans);
  font-size:   var(--fs-xs);
  color:       var(--t2);
}
.gf-map { position: relative; height: 250px; background: var(--bg2); }

/* flow animation — white dashes drifting over the solid colour base line */
.gf-flow      { stroke-dasharray: 5 9;  animation: gf-dash 1.2s linear infinite; }
.gf-flow-main { stroke-dasharray: 4 12; animation: gf-dash .85s linear infinite; }
@keyframes gf-dash { to { stroke-dashoffset: -32; } }
/* Gas-flow dashes keep drifting under prefers-reduced-motion on purpose: it is
   the map's core signal and Android battery-saver silently sets reduced-motion,
   which would otherwise blank the flow for field users on low battery. */
.gf-hub-ic { background: none; border: none; }
.gf-hub-badge {
  display:       inline-block;
  padding:       var(--space-2xs) var(--space-md);
  border:        1.5px solid;
  border-radius: 999px;
  background:    var(--bg1);
  font-family:   var(--font-badge);
  font-size:     var(--fs-xs);
  font-weight:   700;
  white-space:   nowrap;
  box-shadow:    0 1px 4px rgba(0, 0, 0, .25);
}

/* in-map legend (bottom-left) + plant squares */
.gf-maplegend {
  position:      absolute;
  left:          8px;
  bottom:        8px;
  z-index:       var(--z-panel);
  display:       flex;
  gap:           var(--space-lg);
  padding:       var(--space-xs) var(--space-md);
  border:        1px solid var(--bdr);
  border-radius: var(--radius);
  background:    color-mix(in srgb, var(--bg1) 88%, transparent);
  font-family:   var(--font-sans);
  font-size:     var(--fs-2xs);
  color:         var(--t2);
  pointer-events: none;
}
.gf-maplegend span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.gf-maplegend i {
  display: inline-block;
  width:   12px;
  height:  3px;
  border-radius: 2px;
}
.gf-maplegend i.gf-lg-dot {
  width:         7px;
  height:        7px;
  border:        2px solid;
  border-radius: 50%;
  background:    #fff;
}
.gf-maplegend i.gf-lg-sq { width: 8px; height: 8px; background: #EF9F27; border-radius: 2px; }
.gf-fac-ic { background: none; border: none; }
.gf-fac-sq {
  display:       block;
  width:         10px;
  height:        10px;
  background:    #EF9F27;
  border:        1.5px solid #854F0B;
  border-radius: 2px;
}

/* spec rows — the PPT-style comparison facts (System / Contact / Plants / …) */
.gf-specs { padding: var(--space-xs) var(--space-xl) var(--space-sm); border-top: 1px solid var(--bdr); }
.gf-spec  { padding: var(--space-sm) 0; border-bottom: 1px solid var(--bdr); }
.gf-spec:last-child { border-bottom: none; }
.gf-spec-lbl {
  font-family:    var(--font-sans);
  font-size:      var(--fs-2xs);
  font-weight:    600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color:          var(--t2);
  margin-bottom:  var(--space-2xs);
}
.gf-spec-val {
  font-size:   var(--rpt-b, 12.5px);
  line-height: 1.45;
  color:       var(--t1);
}
.gf-dim { color: var(--t2); }

/* chain strip — AOI → gathering → interconnect → hub */
.gf-chains { padding: var(--space-md) var(--space-xl) var(--space-xs); border-top: 1px solid var(--bdr); }
.gf-chain {
  display:     flex;
  align-items: center;
  gap:         var(--space-xs);
  padding:     var(--space-2xs) 0;
  overflow:    hidden;
  white-space: nowrap;
}
.gf-step {
  padding:       var(--space-2xs) var(--space-sm);
  border:        1px solid var(--bdr);
  border-radius: 999px;
  background:    var(--bg2);
  font-family:   var(--font-sans);
  font-size:     var(--fs-xs);
  color:         var(--t1);
  overflow:      hidden;
  text-overflow: ellipsis;
  flex:          0 1 auto;
  min-width:     0;
}
.gf-step-aoi {
  background:   rgba(255, 214, 0, .12);
  border-color: rgba(255, 214, 0, .45);
  color:        var(--t1);
  flex:         none;
}
.gf-step-hub { border-color: var(--bdr2); font-weight: 700; flex: none; }
.gf-arr { color: var(--t2); font-size: var(--fs-xs); flex: none; }
.gf-chain-more {
  font-family: var(--font-sans);
  font-size:   var(--fs-xs);
  color:       var(--t2);
  white-space: normal;
  line-height: 1.5;
}

/* netback footer */
.gf-foot {
  display:     flex;
  align-items: baseline;
  gap:         7px;
  padding:     var(--space-md) var(--space-xl) var(--space-lg);
  border-top:  1px solid var(--bdr);
  margin-top:  auto;
}
.gf-foot-lbl {
  font-family:    var(--font-sans);
  font-size:      var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color:          var(--t2);
}
.gf-foot-val { font-family: var(--font-num); font-size: var(--fs-lg); font-weight: 700; color: var(--t1); }
.gf-foot-val.gf-best { color: var(--ok, #2e9e6b); }
.gf-foot-sub { font-size: var(--fs-micro); color: var(--t2); }

