/* net-metering-explained.html: layout of the components on this page only. Colours, type and spacing come from site.css tokens; nothing here is a new component. */

/* ============================================================ shared guide rules (gd-) */
/* ---- hero: the answer on the left, a drawn figure on the right ---- */
.gd-hero .sb-hero__copy { display: grid; gap: var(--sp-6) var(--col-gap); }
.gd-hero__head, .gd-hero__answer { min-width: 0; }
.gd-hero .sb-answer { margin-top: 0; }
.gd-fig { margin: 0; min-width: 0; }
@media (min-width: 64em) {
  .gd-hero .sb-hero__copy { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto; row-gap: var(--sp-5); padding-bottom: var(--sp-8); }
  .gd-hero__head { grid-column: 1 / -1; grid-row: 1; }
  .gd-hero__answer { grid-column: 1 / span 7; grid-row: 2; }
  .gd-fig { grid-column: 8 / span 5; grid-row: 2; align-self: stretch; }
}
.gd-glyph { flex: none; }

/* ---- the opening paragraphs, with the guide's own sections beside them ---- */
.gd-intro { padding-block: var(--sp-8); }
.gd-intro .sb-split__a > .sb-eyebrow { margin: 0 0 var(--sp-3); font-size: var(--fs-caption); line-height: 1.4; color: var(--text-soft); }
.gd-tools { max-width: 28rem; }
.gd-lead { font-size: var(--fs-lede); line-height: 1.45; color: var(--navy); max-width: 36rem; }
.gd-intro .sb-split__b > p + p { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--rule); }

/* ---- full-width sections (tables and sheets need the room) ---- */
.gd-full .sb-head { margin-bottom: var(--sp-6); }
.gd-full .sb-head p { font-size: 1.25rem; line-height: 1.5; }
@media (min-width: 64em) { .gd-full .sb-head { align-items: start; } }
.gd-full > .wrap > * + * { margin-top: var(--sp-5); }
.gd-full > .wrap > .sb-head { margin-top: 0; }
.gd-full > .wrap > p { max-width: var(--measure); }
.gd-full > .wrap > .sb-source { margin-top: var(--sp-3); }
.gd-full > .wrap > .sb-source + p { margin-top: var(--sp-6); }
.gd-full > .wrap > .sb-source + .sb-source { margin-top: var(--sp-3); }
.gd-full h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--trk-h3); }
/* split sections: question headings are long, so they run a size smaller than a pillar's */
.gd-split .sb-split__a h2 { font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem); }
.gd-split .sb-split__a > p { font-size: 1.1875rem; line-height: 1.5; max-width: 34rem; }
.gd-split .sb-split__b > p + .sb-source { margin-top: var(--sp-3); }
.gd-split .sb-split__b > .sb-source + p { margin-top: var(--sp-5); }

/* ---- the market band: the market name is the link ---- */
.gd-markets .sb-market h3 a { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; color: var(--text-on-dark); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule-on-dark); text-underline-offset: .22em; }
.gd-markets .sb-market h3 a:visited { color: var(--text-on-dark); }
.gd-markets .sb-market h3 a:hover { text-decoration-color: var(--text-on-dark); text-decoration-thickness: 2px; }
.gd-markets .sb-market h3 a svg { flex: none; width: 22px; height: 22px; color: var(--gold); transition: transform var(--t-micro) var(--ease); }
.gd-markets .sb-market h3 a:hover svg, .gd-markets .sb-market h3 a:focus-visible svg { transform: translateX(4px); }
.gd-markets .sb-market h3 { margin-bottom: var(--sp-3); }
.gd-markets .sb-head p { font-size: 1.25rem; line-height: 1.5; }
@media (min-width: 64em) { .gd-markets .sb-head { align-items: start; } }
.sb-links--foot { margin-top: 0; padding-top: 0; border-top: 0; }
.gd-markets .sb-ledger__foot { margin-top: var(--sp-6); display: grid; gap: var(--sp-4) var(--sp-6); }
@media (min-width: 64em) { .gd-markets .gd-foot--src { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } .gd-markets .sb-ledger__foot:not(.gd-foot--src) { grid-template-columns: none; } .gd-markets .gd-foot--src .sb-links { justify-content: flex-end; } }

/* ---- closing, note, sources ---- */
.sb-closing h2 + .gd-close-lede { margin: calc(-1 * var(--sp-3)) 0 var(--sp-5); max-width: 30rem; color: var(--text-soft); }
.gd-notewrap { padding-top: var(--sp-7); }
.gd-sources { padding-top: var(--sp-7); }
.gd-sources__lede { margin-top: var(--sp-3); color: var(--text-soft); max-width: 40rem; }
.gd-sources li { padding-block: 14px; line-height: 1.6; }
.gd-sources li::before { top: 14px; }
/* the linked document title of each source is a chip: bordered, underlined, one box */
.gd-sources a.gd-chip { display: inline-block; min-height: 0; margin: 0 2px 0 0; padding: 1px 9px; line-height: 1.5; font-size: .9375rem; }
@media (min-width: 64em) {
  .gd-sources ol { max-width: none; column-count: 2; column-gap: var(--sp-8); }
  .gd-sources li { break-inside: avoid; }
}

/* ---- rules this page carries itself so it does not depend on other pages ---- */
/* breadcrumb: the slash follows each earlier item, so a trail that wraps never starts a line with one */
.sb-breadcrumb li + li::before { content: none; }
.sb-breadcrumb li:not(:last-child)::after { content: "/"; color: var(--text-soft); }
/* the last word of a text link and its arrow never part (see nbArrows in tools/w2b2-lib.mjs) */
/* nowrap only while the text is at its normal size on a phone (375 px is 23 em); at 150 or 200 percent a word and its arrow may wrap, so nothing is wider than the screen */
@media (min-width: 23em) { .gx-nb { white-space: nowrap; } }
/* a short hyphenated compound in a heading or table head ("made-up") never breaks at its hyphen */
.gx-hy { white-space: nowrap; }
/* headings: only a very long word is hyphenated, so no short word is cut in two and none can overflow at 200% text size */
h1, h2, h3, h4 { hyphens: auto; hyphenate-limit-chars: 12 5 5; overflow-wrap: anywhere; }
/* a link inside a sentence or a table cell flows with the text (the system draws it as an inline block, which leaves holes in a wrapped line) */
p:not(.sb-p-links) > a.sb-link, li > a.sb-link, td > a.sb-link:not(.sb-cell-link), dd > a.sb-link { display: inline; padding-block: 0; }
sup { font-size: max(.875rem, .7em); }   /* a superscript is still 14 px or more */
.gd-split .sb-split__b, .sb-split__a { min-width: 0; }
/* jump bar: a focused item scrolls clear of the edge; below 64em the sections are a wrapped row of chips in the page, nothing pinned, nothing half hidden */
.sb-jump ul { scroll-padding-inline: 32px; }
@media (max-width: 63.99em) {
  .sb-jump { position: static; }
  .sb-jump ul { flex-wrap: wrap; overflow: visible; gap: 8px; padding: 12px 0 14px; }
  .sb-jump a { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--surface); white-space: normal; }
  .sb-jump li:first-child a { padding-left: 14px; }
  .sb-jump a:focus-visible { outline-offset: 2px; }
}
@media (min-width: 48em) and (max-width: 63.99em) and (min-height: 30em) { html:has(.sb-jump) { --sticky-top: var(--h-header); } }
@media (max-width: 47.99em) { html:has(.sb-jump) { --sticky-top: 0px; } }

/* ============================================================ the ledger sheet: a table on paper with a navy head (shared by the guides' data tables) */
.gd-sheet { background: var(--paper); border: 1px solid var(--navy); min-width: 0; }
.gd-scroll { overflow-x: auto; }
.gd-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gd-sheet .sb-table { margin-top: 0; font-size: var(--fs-ui); }
.gd-sheet .sb-table caption { padding: 16px 20px; border-bottom: 1px solid var(--rule); max-width: none; color: var(--text-soft); }
.gd-sheet .sb-table thead th { vertical-align: middle; padding: 14px 20px 10px; }
.gd-sheet .sb-table tbody th, .gd-sheet .sb-table tbody td { padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.gd-sheet .sb-table tbody tr:last-child > * { border-bottom: 0; }
.gd-sheet .sb-table td:last-child, .gd-sheet .sb-table th:last-child { padding-right: 20px; }
@media (max-width: 47.99em) {
  .gd-sheet .sb-table caption { padding: 14px 16px; }
  .gd-sheet .sb-table--stack tbody tr { padding: 16px; border-bottom: 1px solid var(--rule); }
  .gd-sheet .sb-table--stack tbody tr:last-child { border-bottom: 0; }
  .gd-sheet .sb-table--stack tbody th, .gd-sheet .sb-table--stack tbody td { padding: 3px 0; border-bottom: 0; }
  .gd-sheet .sb-table--stack tbody td:last-child { padding-right: 0; }
}
/* a table of four or more columns stacks up to 64em, because four narrow columns break words at tablet width (the same rules as the site's phone stack) */
@media (min-width: 48em) and (max-width: 63.99em) {
  .gd-wide.sb-table--stack thead { display: none; }
  .gd-wide.sb-table--stack, .gd-wide.sb-table--stack tbody, .gd-wide.sb-table--stack tr, .gd-wide.sb-table--stack th, .gd-wide.sb-table--stack td { display: block; width: 100%; }
  .gd-wide.sb-table--stack tbody tr { padding: 18px 20px; border-bottom: 1px solid var(--rule); }
  .gd-wide.sb-table--stack tbody tr:last-child { border-bottom: 0; }
  .gd-sheet .gd-wide.sb-table--stack tbody th, .gd-sheet .gd-wide.sb-table--stack tbody td { padding: 3px 0; border: 0; }
  .gd-wide.sb-table--stack tbody th { font-size: 1.0625rem; padding-bottom: 6px; }
  .gd-wide.sb-table--stack td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--text-soft); }
  .gd-sheet .gd-wide.sb-table--stack tbody td:last-child { padding-right: 0; }
  .gd-wide.sb-table--stack caption { display: block; }
}

/* a guide row's one-line description never runs past 32 rem, so a single-column list at tablet width stays inside the 85-character line */
.gd-related .sb-guide__d { max-width: 32rem; }
/* a link that is the whole text of a table cell, or the document in a ledger row: a 44 px hit area drawn from the row's own padding (the site rule, with a floor so one line reaches 44) */
.sb-table a.sb-cell-link { box-sizing: border-box; min-height: 44px; }

/* the answer box matches the height of the figure beside it; its source line sits at the foot of the box, under a rule, so the extra height reads as a footer and not as a gap */
@media (min-width: 64em) {
  .gd-hero__answer { display: flex; flex-direction: column; }
  .gd-hero__answer > .sb-source { margin-top: auto; }
}


/* ============================================================ this page */
/* ---- hero: the made-up month's net, as a ruled receipt ---- */
.nm-plate { align-self: end; padding: var(--sp-4); background: var(--paper); border: 1px solid var(--navy); }
.nm-receipt { margin: var(--sp-3) 0 0; }
.nm-receipt > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.nm-receipt dt { max-width: 13rem; font-size: var(--fs-body); line-height: 1.35; color: var(--navy); }
.nm-receipt dd { margin: 0; flex: none; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--brand); overflow-wrap: anywhere; }
.nm-receipt small { margin-left: .3em; font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--navy-soft); }
.nm-receipt__minus dd > span:first-child { margin-right: .08em; font-weight: 500; color: var(--navy-soft); }
.nm-receipt > .nm-receipt__total { border-top: 3px double var(--navy); }
.nm-receipt__total dt { font-weight: 600; }
@media (min-width: 48em) { .nm-plate { padding: var(--sp-5); } }

/* ---- on your bill: three bars on one scale, and the list that says the same in words ---- */
.nm-flow { margin: 0; }
.nm-flow figcaption { max-width: none; margin-bottom: var(--sp-5); font-size: var(--fs-ui); font-weight: 600; color: var(--navy); }
.nm-flow__grid { display: grid; gap: var(--sp-6) var(--col-gap); }
.nm-flow__chart { padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line-strong); min-width: 0; }
.nm-flow__chart > .sb-worked__lab { margin-bottom: var(--sp-3); }
.nm-flow__row + .nm-flow__row { margin-top: var(--sp-4); }
.nm-flow__h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 6px; font-size: var(--fs-ui); line-height: 1.35; color: var(--navy); }
.nm-flow__h b { font-weight: 600; color: var(--brand); text-align: right; }
.nm-bar { display: flex; flex-wrap: wrap; min-height: 64px; }
.nm-seg { display: flex; align-items: center; justify-content: center; flex: none; width: var(--w); min-width: max-content; min-height: 64px; padding-inline: 6px; font-style: normal; text-align: center; }
.nm-seg b { display: flex; flex-direction: column; align-items: center; font-size: 1.25rem; font-weight: 600; line-height: 1.05; }
.nm-seg small { font-size: var(--fs-caption); font-weight: 500; }
.nm-seg--own { background: var(--navy); color: var(--paper); }
.nm-seg--grid { background: var(--sky-text); color: var(--paper); }
.nm-seg--out { background: var(--surface); color: var(--navy); border: 2px dashed var(--navy); }
.nm-seg--pad { background: none; }
.nm-key { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-ui); line-height: 1.4; }
.nm-key li { display: flex; align-items: center; gap: 10px; }
.nm-key .nm-seg { width: 28px; min-width: 28px; height: 20px; min-height: 20px; padding: 0; }
.nm-flow__text .sb-plain-list { margin-top: 0; }
.nm-flow__text > p { margin-top: var(--sp-4); max-width: var(--measure); }
.nm-how__after { max-width: var(--measure); }
@media (min-width: 64em) {
  .nm-flow__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .nm-flow__chart { grid-column: 1 / span 7; }
  .nm-flow__text { grid-column: 9 / span 4; }
}

/* ---- the models table, then the three rate words ---- */
@media (min-width: 48em) {
  .nm-models .sb-table thead th:nth-child(1), .nm-models .sb-table tbody th { width: 18%; }
  .nm-models .sb-table td { width: 41%; }
}
.nm-models__more { max-width: var(--measure); }
.nm-rate { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 2px solid var(--navy); display: grid; gap: var(--sp-5) var(--col-gap); }
.nm-rate__a > p { margin-top: var(--sp-3); max-width: 28rem; font-size: var(--fs-lede); line-height: 1.45; color: var(--text-soft); }
.nm-rate__b .sb-source { margin-top: var(--sp-3); }
.nm-rate__b .sb-definition { margin-top: 0; }
@media (min-width: 64em) {
  .nm-rate { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .nm-rate__a { grid-column: 1 / span 4; }
  .nm-rate__b { grid-column: 6 / span 7; }
}

/* ---- worked bills: the inputs and a bar chart, then the arithmetic ---- */
.nm-worked__top { display: grid; gap: var(--sp-5) var(--col-gap); }
.nm-worked__in .sb-plain-list { margin-top: 0; }
.nm-bills { margin: 0; padding: var(--sp-5); background: var(--paper); border: 1px solid var(--navy); min-width: 0; }
.nm-bills__row { display: grid; gap: 4px; margin-top: var(--sp-3); }
.nm-bills__k { font-size: var(--fs-ui); font-weight: 600; color: var(--navy); }
.nm-bills__bar { display: flex; align-items: center; justify-content: flex-end; width: var(--w); min-width: 6.5rem; height: 40px; padding-inline: 12px; background: var(--navy); color: var(--paper); }
.nm-bills__bar b { font-size: var(--fs-ui); font-weight: 600; }
.nm-takeaway .sb-plain-list { margin-top: 0; }
.nm-takeaway { margin-top: var(--sp-6); }
@media (min-width: 64em) {
  .nm-worked__top { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .nm-worked__in { grid-column: 1 / span 6; }
  .nm-bills { grid-column: 7 / span 6; }
  .nm-takeaway .sb-plain-list { columns: 1; max-width: 46rem; }
}
.nm-worked .sb-table--worked tbody td:last-child { width: auto; }
@media (min-width: 48em) { .nm-worked .sb-table--worked thead th:first-child { width: 20%; } .nm-worked .sb-table--worked td:last-child, .nm-worked .sb-table--worked thead th:last-child { width: 16%; white-space: nowrap; } }
.nm-worked .gd-sheet { margin-top: var(--sp-6); }
/* carrying credit forward: the heading on the left, the made-up months on the right */
.nm-carry { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 2px solid var(--navy); display: grid; gap: var(--sp-5) var(--col-gap); }
.nm-carry__a > p { margin-top: var(--sp-3); max-width: 30rem; }
.nm-carry__b > p { margin-top: var(--sp-4); max-width: var(--measure); }
.nm-carry__b > .sb-source { margin-top: var(--sp-3); }
.nm-carry__b > .sb-table, .nm-carry__b > .sb-table-wrap { margin-top: 0; }
@media (min-width: 64em) {
  .nm-carry { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .nm-carry__a { grid-column: 1 / span 4; }
  .nm-carry__b { grid-column: 5 / span 8; }
}

/* ---- seven questions: each row is numbered ---- */
.nm-seven { counter-reset: seven; }
.nm-seven li { counter-increment: seven; position: relative; padding-left: 52px; }
.nm-seven li::before { content: counter(seven) / ""; position: absolute; left: 0; top: 14px; display: grid; place-items: center; width: 32px; height: 32px; background: var(--navy); color: var(--paper); font-size: var(--fs-ui); font-weight: 600; line-height: 1; }
.nm-choices .sb-split__b > .sb-plain-list { margin-top: 0; }

/* links that sit in a row in one table cell (NLR; BPU staff; EIA) are one rectangle each, so a focused one keeps its whole ring when the line wraps */
.nm-models .sb-table td a:not(.sb-link) { display: inline-block; max-width: 100%; padding-block: 1px; }

/* ============================================================ adjustments on this page only */
/* a short citation group in a table cell, "(NLR;" or "BPU staff).": the bracket and the semicolon never part from their link, so a line never starts with ";" or ends with "(" */
.nm-cite { white-space: nowrap; }
/* the first column of the models table holds the model names: at tablet width they stay on one line */
@media (min-width: 48em) and (max-width: 63.99em) {
  .nm-models .sb-table thead th:nth-child(1), .nm-models .sb-table tbody th { width: 22%; white-space: nowrap; }
  .nm-models .sb-table td { width: 39%; }
}
/* this page's jump bar has nine items and needs about 1,115 px in one row: below 80em it is a wrapped row of chips, not a sticky row that hides its last items behind a scroll bar */
@media (min-width: 64em) and (max-width: 79.99em) {
  .sb-jump { position: static; }
  .sb-jump ul { flex-wrap: wrap; overflow: visible; gap: 8px; padding: 12px 0 14px; }
  .sb-jump a { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--surface); white-space: normal; }
  .sb-jump li:first-child a { padding-left: 14px; }
  .sb-jump a:focus-visible { outline-offset: 2px; }
}
@media (min-width: 64em) and (max-width: 79.99em) and (min-height: 30em) { html:has(.sb-jump) { --sticky-top: var(--h-header); } }
/* hero receipt: an 11 rem label leaves room for the number beside it, so all three rows read the same at 1024 px */
.nm-receipt dt { max-width: 11rem; }
/* at 80em and wider the single row needs 70 rem of room: with larger text the 1240 px page width is less than that, so the bar's own width grows with the text size (never past the screen) */
@media (min-width: 80em) { .sb-jump .wrap { width: min(100% - 2 * var(--gutter), max(var(--container), 72rem)); } }
