/* The Texas filings page, v2 (Thomas via HQ, 2026-11-13/14): a dense list of
 * the T-1 filers and, beside it, the one that is open. The list, the
 * selection head, the stat strip and the source line are the Texas page's
 * (texas.css); this sheet holds what is this page's own. Tokens only.
 *
 * NOTHING SCROLLS SIDEWAYS and nothing is cut with an ellipsis: names wrap,
 * figures stay on a line, and the chart is drawn at the width it is shown. */

.txf { max-width: 1280px; margin: 0 auto; padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.txf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }

/* The list alone takes the page. With a filer open it is the narrow column
 * and keeps the three columns that say which filer and how much. */
.txf-work { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.txf-work.is-open { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); }
.txf-work.is-open .hide-open { display: none; }
.txf-list { min-width: 0; align-self: start; }
.txf-work.is-open .txf-list { position: sticky; top: var(--sp-2); max-height: calc(100vh - var(--sp-4)); overflow-y: auto; }
.txf-table { width: 100%; }
.txf-table td:first-child { white-space: normal; overflow-wrap: break-word; font-family: var(--font-ui); }
.txf-reg { color: var(--ink-faint); font-family: var(--font-data); font-size: var(--t-label); white-space: nowrap; }
.txf-table tr.is-on > td { background: var(--surface-2); }
.txf-table tr.is-on > td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.txf-spark .spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.5; }

/* The open filer: its head and four figures, then the panels one under
 * another. On a phone one panel shows at a time, behind three tabs. */
.txf-work > .txf-list { grid-column: 1; grid-row: 1; }
.txf-work.is-open > .txf-detail { grid-column: 2; grid-row: 1; }
.txf-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); min-width: 0; }
/* The selection head is the Texas page's, which names a grid area there and
 * stacks its figures in a narrow column. Here they are one row of four (two
 * by two on a phone), hairlines between. */
.txf-detail .tx-sel { grid-area: auto; }
.txf-detail .tx-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
                        border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.txf-detail .tx-stat { display: flex; flex-direction: column; min-width: 0; padding: var(--sp-2) var(--sp-3); border: 0; }
.txf-detail .tx-stat:first-child { padding-left: 0; }
.txf-detail .tx-stat + .tx-stat { border-left: 1px solid var(--line); }
/* A colour chip: in the legend and at the head of a list row. */
.txf-detail .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
.txf-detail[hidden] { display: none; }
.txf-tabs { display: none; }
.txf-panel { box-shadow: none; min-width: 0; }
.txf-panel .panel-header { flex-wrap: wrap; }
.txf-panel .panel-header h4 { margin: 0; }
.txf-panel .panel-header .spacer { margin-left: auto; }
.txf-view .seg-btn { padding: 2px 8px; font-size: var(--t-label); }

.txf-chart { display: block; max-width: 100%; height: auto; }
.txf-axis { font-family: var(--font-data); font-size: 10px; fill: var(--ink-faint); }
.txf-grid { stroke: var(--line); stroke-width: 1; }
.txf-base { stroke: var(--line-strong); stroke-width: 1; }
.txf-gap { fill: var(--surface-2); }
.txf-chart rect.is-light { opacity: 0.45; }
.txf-chart .c-s1, .sw.c-s1 { fill: var(--series-1); background: var(--series-1); }
.txf-chart .c-s2, .sw.c-s2 { fill: var(--series-2); background: var(--series-2); }
.txf-chart .c-s3, .sw.c-s3 { fill: var(--series-3); background: var(--series-3); }
.txf-chart .c-s4, .sw.c-s4 { fill: var(--series-4); background: var(--series-4); }
.txf-chart .c-s5, .sw.c-s5 { fill: var(--series-5); background: var(--series-5); }
.txf-chart .c-s6, .sw.c-s6 { fill: var(--series-6); background: var(--series-6); }
.txf-chart .c-other, .sw.c-other { fill: var(--series-other); background: var(--series-other); }
.txf-chart .c-blank, .sw.c-blank { fill: var(--line-strong); background: var(--line-strong); }

/* A reference line, dashed (dashes are for reference lines only): a
 * refinery's capacity, for scale. Its words sit on the surface, not on bars. */
.txf-rule { stroke: var(--ink-body); stroke-width: 1; stroke-dasharray: 4 3; }
.txf-rule-label { fill: var(--ink-body); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

/* The refineries view: what is live says so; what is not yet shown is a
 * one-line card with a dashed edge, never an empty chart. */
.txf-ruled { margin: 0; }
.txf-tag { font-family: var(--font-data); font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.06em;
           padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.txf-live { color: var(--accent-measured-ink); border-color: var(--accent-measured); }
.txf-wait { color: var(--ink-faint); border-style: dashed; }
.txf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-2); }
.txf-card { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); min-width: 0;
            border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); padding: var(--sp-2) var(--sp-3);
            font-family: var(--font-ui); font-size: var(--t-data); color: var(--ink); }

.txf-readout { min-height: 1.2em; margin: 2px 0 0; }
.txf-legend { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); margin: var(--sp-1) 0 var(--sp-2); }
.txf-key { color: var(--ink-faint); }
.txf-parties { width: 100%; }
.txf-parties td:first-child { white-space: normal; overflow-wrap: break-word; font-family: var(--font-ui); }
.txf-parties th { white-space: normal; }
.txf-where { color: var(--ink-body); font-size: var(--t-label); padding-left: 15px; overflow-wrap: anywhere; }
.txf-num { font-family: var(--font-data); color: var(--ink-faint); }
.txf-quiet td { color: var(--ink-body); }
.txf-total td { font-weight: 500; border-top: 1px solid var(--line-strong); }

@media (max-width: 1000px) {
  .txf-work.is-open { grid-template-columns: minmax(0, 1fr); }
  .txf-work.is-open > .txf-detail { grid-column: 1; grid-row: 2; }
  .txf-work.is-open .txf-list { position: static; max-height: none; overflow: visible; }
  .txf-work.is-open .hide-open { display: table-cell; }
}
@media (max-width: 700px) {
  .txf { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .txf .hide-sm, .txf-work.is-open .hide-open.hide-sm { display: none; }
  .txf-table { table-layout: auto; }
  .txf-table td, .txf-table th, .txf-parties td, .txf-parties th { padding-left: var(--sp-1); padding-right: var(--sp-1); }
  .txf-reg { display: block; }
  .txf-under > td { padding: var(--sp-2) 0 var(--sp-3); white-space: normal; text-align: left; }
  .txf-detail .tx-stats { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .txf-detail .tx-stat, .txf-detail .tx-stat:first-child { padding: var(--sp-2) var(--sp-2) var(--sp-2) 0; }
  .txf-detail .tx-stat + .tx-stat { border-left: 0; }
  .txf-detail .tx-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .txf-tabs { display: flex; }
  .txf-tabs .seg-btn { flex: 1 1 0; }
  .txf-detail[data-kind="filer"] .txf-panel { display: none; }
  .txf-detail[data-panel="out"] .txf-panel[data-panel="out"],
  .txf-detail[data-panel="in"] .txf-panel[data-panel="in"],
  .txf-detail[data-panel="stock"] .txf-panel[data-panel="stock"] { display: block; }
}
