.page-gas [hidden] { display: none !important; }
/* Misses carry two meanings, so two hues: gold = estimate too high, blue =
   estimate too low. Neither is the grey of muted or disabled text. Both
   clear 4.5:1 on --surface and --bg in their theme. */
.page-gas { --gas-low: #85b5ff; }
[data-theme="light"] .page-gas { --gas-low: #165fb9; }
.gas-skip { position: fixed; inset: 8px auto auto 8px; z-index: 101; padding: 12px 18px; background: var(--surface); color: var(--text); transform: translateY(-150%); }
.gas-skip:focus { transform: none; }
.gas-page { padding-top: clamp(40px, 6vw, 72px); }
.gas-app { display: grid; gap: 32px; }
.gas-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; }
.gas-zone-field { display: grid; gap: 8px; }
.gas-zone-field label { font-size: 14px; font-weight: 600; }
.gas-zone-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.gas-zone-controls > a { display: inline-flex; align-items: center; min-height: 44px; }
.gas-zone-controls select { min-height: 48px; min-width: 174px; padding: 10px 38px 10px 16px; border-radius: 10px; border: 1px solid var(--gold-hairline); background: var(--surface); color: var(--text); font: inherit; }
/* Type scale for the whole app: 15px secondary copy, 13px captions. */
/* The freshness line and the control that re-reads the feed share one bar,
   so the refresh reads as part of the status, not as the page's action. */
.gas-status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 14px 12px 20px; border: 1px solid var(--separator); border-left: 3px solid var(--gold-text); border-radius: 0 12px 12px 0; }
.gas-status-bar:has(.gas-feed-status[data-state="fresh"]) { border-left-color: var(--gold-hairline); }
.gas-feed-status { flex: 1 1 320px; min-width: 0; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.gas-refresh { flex: none; min-height: 44px; }
.gas-refresh:disabled { opacity: .7; cursor: wait; }
.gas-content { display: grid; gap: clamp(40px, 6vw, 64px); min-width: 0; }
/* Both cards run to the same foot, with their closing disclosures on one
   line, however much the estimate card has to say. */
.gas-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.gas-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: clamp(22px, 3vw, 32px); background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.gas-card > * { align-self: stretch; }
.gas-card > a { align-self: flex-start; }
.gas-card > .gas-details:last-child { margin-top: auto; }
.gas-card > :nth-last-child(2) { margin-bottom: 24px; }
.gas-card h2 { font-size: clamp(20px, 2.4vw, 26px); }
.gas-card .eyebrow { margin-bottom: 12px; }
.gas-card-estimate { border-color: var(--gold-hairline); }
/* Withheld: the estimate card steps back to a dashed, unshadowed outline
   that keeps its full slot beside the official price (no void under a
   short card). Its status sits in the badge; the note and the link to the
   saved record sit centred in the slot. */
.gas-price-grid.is-withheld { grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.gas-price-grid.is-withheld .gas-card-estimate { display: flex; flex-direction: column; border: 1px dashed var(--gold-hairline); background: transparent; box-shadow: none; }
.gas-price-grid.is-withheld .gas-card-estimate .gas-card-top { margin-bottom: 0; }
.gas-withheld { display: grid; gap: 14px; justify-items: start; margin-block: auto; padding-block: 28px; }
.gas-withheld-note { max-width: 34ch; color: var(--text-muted); font-size: 15px; line-height: 1.65; }
.gas-withheld-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.gas-withheld-link::after { content: "↓" / ""; margin-left: 6px; }
.gas-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.gas-card-top h2 { font-size: 19px; }
.gas-badge { display: inline-flex; padding: 5px 10px; border: 1px solid var(--gold-hairline); border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; color: var(--gold-text); }
.gas-price { font-size: clamp(46px, 6vw, 70px); font-weight: 600; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gas-price-unit { margin-top: 7px; font-size: 13px; color: var(--text-muted); }
.gas-price-maximum { margin-top: 20px; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gas-card-note { margin-top: 14px; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.gas-change { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 16px; font-weight: 600; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.gas-change::before { content: "→" / ""; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-hairline); font-size: 15px; line-height: 1; }
.gas-change[data-direction="down"]::before { content: "↓" / ""; }
.gas-change[data-direction="up"]::before { content: "↑" / ""; }
.gas-card-estimate .gas-price-maximum { padding-top: 18px; border-top: 1px solid var(--separator); }
.gas-coverage { margin-top: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.gas-empty { margin-top: 18px; font-size: 24px; font-weight: 500; }
.gas-notice { padding: 20px; border: 1px solid var(--gold-hairline); border-radius: 12px; line-height: 1.65; }
.gas-details { margin-top: 24px; border-top: 1px solid var(--separator); padding-top: 8px; }
.gas-details summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 500; font-size: 15px; color: var(--text); }
.gas-details summary::-webkit-details-marker { display: none; }
.gas-details summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s var(--ease); }
.gas-details[open] > summary::before { transform: rotate(45deg); }
.gas-details > summary { list-style: none; }
.gas-details > :not(summary) { margin-top: 16px; }
.gas-details ul { padding-left: 20px; display: grid; gap: 10px; color: var(--text-muted); font-size: 15px; }
.gas-components { display: grid; gap: 12px; font-size: 15px; }
.gas-components > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.gas-components dt { color: var(--text-muted); }
.gas-components dd { font-variant-numeric: tabular-nums; }
.gas-section { min-width: 0; }
/* The test results and the sources each open a new movement: a hairline
   and the same breathing room above as below, so the long run from the
   ledger to the watch card has resting points. */
.gas-performance, .gas-sources { padding-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--separator); }
.gas-section .section-title { font-size: clamp(25px, 3.4vw, 34px); }
.gas-section .section-head { margin-bottom: 24px; }
.gas-section-note { margin-top: 20px; max-width: 78ch; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.gas-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gas-stat { padding: 24px; border: 1px solid var(--separator); border-radius: 16px; background: var(--surface); }
.gas-stat h3 { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.gas-stat-value { margin-top: 16px; font-size: clamp(26px, 3vw, 36px); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.gas-stat p:last-child { margin-top: 10px; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Scroll shadows: an edge fades in only on the side that has more table,
   so a clipped column always shows that it can be scrolled to. */
.gas-table-wrap {
  /* Every table sits on the card surface, so its rows, header and caption
     read as one sheet (not page-coloured rows under a surface header). */
  --wrap-bg: var(--surface);
  max-width: 100%; overflow-x: auto; border: 1px solid var(--separator); border-radius: 12px;
  background:
    linear-gradient(to right, var(--wrap-bg, var(--bg)) 40%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--wrap-bg, var(--bg)) 40%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .45), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .45), transparent) right center / 14px 100% no-repeat scroll,
    var(--surface);
}
.gas-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; font-variant-numeric: tabular-nums; }
.gas-table caption { padding: 14px 16px; text-align: left; font-size: 13px; color: var(--text-muted); background: var(--surface); }
.gas-table th, .gas-table td { padding: 14px 16px; border-top: 1px solid var(--separator); vertical-align: top; }
.gas-table thead th { background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-muted); }
.gas-table tbody th { font-weight: 500; }
.gas-table td { white-space: nowrap; }
.gas-table tr[data-selected="true"] { background: var(--fill-2); }
.gas-all-zones { margin-top: 24px; }
.gas-watch { padding: clamp(22px, 3vw, 32px); background: var(--surface); border: 1px solid var(--gold-hairline); border-radius: var(--radius-card); }
.gas-watch-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
/* Same title scale as the page's other section heads. */
.gas-watch .section-title { font-size: clamp(25px, 3.4vw, 34px); }
.gas-watch-status { font-size: clamp(19px, 2.5vw, 24px); font-weight: 500; }
.gas-watch-gap { margin-top: 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.gas-watch-description { margin: 18px 0; max-width: 75ch; color: var(--text-muted); font-size: 15px; }
.gas-observations { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0; margin: 16px 0 22px; font-size: 13px; color: var(--text-muted); }
.gas-observations li { font-variant-numeric: tabular-nums; }
.gas-watch .gas-table-wrap { margin-top: 24px; }
/* The scroll-shadow covers must match whatever the table sits on, or they
   paint dark smears on both edges of a table that does not overflow. */
.gas-watch .gas-table-wrap, .gas-card .gas-table-wrap { --wrap-bg: var(--surface); }
.gas-ledger { scroll-margin-top: 88px; }
.gas-ledger .gas-table { min-width: 630px; }
.gas-ledger-details { margin-top: 28px; }
.gas-ledger-details summary { padding: 0; }
.gas-comparison { padding: clamp(18px, 3vw, 28px); margin: 0 0 24px; border: 1px solid var(--separator); border-radius: 16px; background: var(--surface); }
.gas-comparison-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.gas-comparison-controls label { font-size: 15px; font-weight: 500; }
.gas-comparison-select { max-width: 100%; min-height: 44px; padding: 8px 36px 8px 12px; border: 1px solid var(--gold-hairline); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.gas-comparison-select:disabled { opacity: .65; }
.gas-comparison-explanation, .gas-comparison-empty { margin-top: 16px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.gas-comparison-result { margin-top: 24px; font-size: 16px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.gas-comparison-caption { margin-top: 8px; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.gas-comparison-key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-muted); }
.gas-comparison-key li { display: inline-flex; align-items: center; gap: 8px; }
.gas-comparison-key li::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--gold-text); }
.gas-comparison-key .gas-comparison-key-low::before { background: var(--gas-low); }
.gas-comparison-frame { display: grid; grid-template-columns: 46px minmax(0, 1fr); margin-top: 38px; }
.gas-comparison-axis { position: relative; height: 200px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.gas-comparison-unit { position: absolute; right: 10px; top: -28px; }
.gas-comparison-tick { position: absolute; right: 10px; transform: translateY(-50%); }
.gas-comparison-tick-0 { top: 0; }
.gas-comparison-tick-1 { top: 25%; }
.gas-comparison-tick-2 { top: 50%; color: var(--text); font-weight: 600; }
.gas-comparison-tick-3 { top: 75%; }
.gas-comparison-tick-4 { top: 100%; }
.gas-comparison-scroll { min-width: 0; overflow-x: auto; padding-bottom: 6px;
  background:
    linear-gradient(to left, var(--surface) 40%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .4), transparent) right center / 14px 100% no-repeat scroll; }
.gas-comparison-canvas { width: max-content; min-width: 100%; }
.gas-comparison-svg { display: block; width: 100%; height: 200px; overflow: hidden; }
.gas-comparison-grid { stroke: var(--separator); stroke-width: 1; }
.gas-comparison-zero { stroke: var(--text-muted); stroke-width: 2; }
.gas-comparison-bar, .gas-comparison-exact { fill: var(--gold-text); }
/* Below zero = the estimate was too low: the second hue, so the over/under
   pattern the explanation above describes reads at a glance. */
.gas-comparison-bar[data-error^="-"] { fill: var(--gas-low); }

.gas-comparison-labels { display: flex; padding-top: 12px; }
.gas-comparison-point { display: grid; flex: 1 0 64px; gap: 4px; padding: 0 4px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.gas-comparison-value { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* One line per saved issue: label, value, then the issue time under the
   value, so First and Latest read as a pair without doubling row height. */
.gas-issue { display: grid; grid-template-columns: 3.6em auto; align-items: baseline; column-gap: 10px; row-gap: 2px; margin-bottom: 10px; }
.gas-issue:last-child { margin-bottom: 0; }
.gas-issue-label { font-size: 13px; color: var(--text-muted); }
.gas-issue-time { grid-column: 2; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Errors carry the chart's fills: gold too high, blue too low, and an
   exact match set bold, so the ledger reads as the graph in figures. */
.gas-issue-value[data-sign="high"] { color: var(--gold-text); font-weight: 500; }
.gas-issue-value[data-sign="low"] { color: var(--gas-low); font-weight: 500; }
.gas-issue-value[data-sign="exact"] { font-weight: 700; }
.gas-source-list { display: grid; gap: 14px; padding-left: 20px; font-size: 15px; overflow-wrap: anywhere; }
.gas-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.gas-footer .footer-tagline { flex-basis: 100%; }
.gas-footer .font-toggle { margin-left: auto; min-height: 44px; }
.gas-footer .footer-legal-links a { font-size: 15px; }
@media (max-width: 700px) {
  .gas-price-grid,
  .gas-price-grid.is-withheld { grid-template-columns: 1fr; }
  .gas-comparison-frame { grid-template-columns: 38px minmax(0, 1fr); }
  .gas-comparison-point { padding: 0 2px; font-size: 13px; }
  /* The ledger restacks as one card per effective date: the date heads
     the card, each saved estimate takes one full-width line (label, price,
     issue time), then the official outcome and the error sit side by side.
     Nothing wraps into a three-line timestamp or runs off a phone. */
  .gas-ledger .gas-table { min-width: 0; }
  .gas-ledger .gas-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gas-ledger .gas-table, .gas-ledger .gas-table tbody { display: block; }
  .gas-ledger .gas-table caption { display: block; }
  .gas-ledger .gas-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; padding: 16px 14px; border-top: 1px solid var(--separator); }
  .gas-ledger td[data-label="Saved estimate"] { grid-column: 1 / -1; }
  .gas-ledger td[data-label="Saved estimate"] .gas-issue { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; margin-bottom: 6px; }
  .gas-ledger td[data-label="Saved estimate"] .gas-issue-label { flex: none; width: 3.6em; }
  .gas-ledger td[data-label="Saved estimate"] .gas-issue-time { margin-left: auto; }
  .gas-ledger td[data-label="Error"] .gas-issue { margin-bottom: 6px; }
  .gas-withheld { padding-block: 18px 0; }
  .gas-ledger .gas-table tbody th { grid-column: 1 / -1; padding: 0; border: 0; font-size: 16px; }
  .gas-ledger .gas-table td { padding: 0; border: 0; white-space: normal; min-width: 0; }
  .gas-ledger .gas-table td::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
  .gas-stat-grid { grid-template-columns: 1fr; }
  .gas-stat { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
  .gas-stat-value { margin-top: 0; font-size: 27px; }
  .gas-stat p:last-child { grid-column: 1 / -1; margin-top: 0; }
  .gas-table th, .gas-table td { padding: 12px; }
  .gas-footer .font-toggle { margin-left: 0; }
}
/* Phone: dates under the bars drop the year (the result line above names
   it), so neighbouring labels keep clear space between them. */
.gas-comparison-year { white-space: nowrap; }
@media (max-width: 480px) {
  .gas-comparison-year { display: none; }
}
@media (max-width: 380px) {
  .gas-stat { display: block; }
  .gas-stat-value { margin: 12px 0 8px; }
}
