/* Live NEM spot prices page (/nem-spot-prices). Loaded by that page only.
   Kept apart from style.css, which has CRLF line endings and is shared by every page. */

.nem-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 15px;
  color: var(--text-color);
}

.nem-live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--heading-color-1);
  margin-right: 6px;
  vertical-align: middle;
}

.nem-status[data-state="stale"] .nem-live-dot,
.nem-status[data-state="failed"] .nem-live-dot {
  background: #d97706;
}

.nem-banner {
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 15px;
  background: #fff7e6;
  border: 1px solid #f3c77a;
  color: #7a4b00;
}

.nem-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 4px solid var(--region-color, var(--heading-color-2));
  border-radius: 8px;
  padding: 18px 18px 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nem-card-region {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color-3);
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nem-price {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--heading-color-3);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.nem-price-unit {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-left: 4px;
}

.nem-card[data-band="negative"] .nem-price { color: #3f7d26; }
.nem-card[data-band="high"] .nem-price { color: #b45309; }
.nem-card[data-band="extreme"] .nem-price { color: #b91c1c; }

.nem-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.nem-badge--negative { background: #e8f5e1; color: #3f7d26; }
.nem-badge--high { background: #fff1db; color: #b45309; }
.nem-badge--extreme { background: #fde2e2; color: #b91c1c; }
.nem-badge--unfirm { background: #eef2f7; color: #475569; }

.nem-meta {
  font-size: 13px;
  color: #4b5563;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.nem-spark {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: auto;
}

.nem-spark .zero, .nem-chart .zero {
  stroke: #9ca3af;
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.nem-spark polyline {
  fill: none;
  stroke: var(--region-color, var(--heading-color-2));
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.nem-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.nem-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}

.nem-chart .grid { stroke: #eef0f3; stroke-width: 1; }
.nem-chart .axis { font-size: 11px; fill: #6b7280; font-family: inherit; }
.nem-chart polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.nem-chart .cursor { stroke: #9ca3af; stroke-width: 1; }

.nem-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nem-legend span {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--region-color);
}

.nem-readout {
  font-size: 13px;
  color: #4b5563;
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.nem-neg-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.nem-neg-strip div {
  border-left: 3px solid var(--region-color);
  padding-left: 10px;
}

.nem-neg-strip strong {
  display: block;
  font-size: 24px;
  color: var(--heading-color-3);
  font-variant-numeric: tabular-nums;
}

.nem-neg-strip small { color: #6b7280; font-size: 13px; }

.nem-attribution {
  font-size: 13px;
  color: #4b5563;
  border-left: 3px solid var(--heading-color-1);
  padding-left: 12px;
}

.nem-faq details {
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 0;
}

.nem-faq summary {
  font-weight: 600;
  color: var(--heading-color-3);
  cursor: pointer;
}

.nem-faq details p { margin: 10px 0 0; }

.nem-qld { --region-color: #8a2846; }
.nem-nsw { --region-color: #1f6fb2; }
.nem-vic { --region-color: #0a4a56; }
.nem-sa  { --region-color: #d27a1f; }
.nem-tas { --region-color: #3c8d2f; }

/* Region page facts, region links, tracker tabs and table. */
.nem-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.nem-facts div { border-left: 3px solid var(--region-color); padding-left: 10px; }
.nem-facts dt { font-size: 13px; font-weight: 500; color: #6b7280; }
.nem-facts dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--heading-color-3);
  font-variant-numeric: tabular-nums;
}

.nem-card-region a { color: inherit; text-decoration: none; }
.nem-card-region a:hover { text-decoration: underline; }

.nem-region-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nem-region-links a, .nem-tab, .nem-download {
  display: inline-block;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  color: var(--heading-color-3);
  background: #fff;
  text-decoration: none;
  line-height: 1.5;
}

.nem-region-links a:hover, .nem-tab:hover, .nem-download:hover { border-color: var(--heading-color-2); }
.nem-region-links a[aria-current="page"] {
  background: var(--heading-color-3);
  border-color: var(--heading-color-3);
  color: #fff;
}

.nem-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.nem-tab { cursor: pointer; font-weight: 500; }
.nem-tab[aria-pressed="true"] {
  background: var(--region-color);
  border-color: var(--region-color);
  color: #fff;
}

.nem-chart rect:focus { outline: none; stroke: var(--heading-color-3); stroke-width: 2; }

.nem-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.nem-table th, .nem-table td { text-align: right; white-space: nowrap; }
.nem-table th:first-child { text-align: left; }

/* Shorter hero on the NEM pages, so the live cards start on the first screen.
   The site hero is 245px of top padding plus an 80px spacer under a large h1. */
section.hero-banner.nem-hero { padding-top: 150px; }
.nem-hero h1 { font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.1; }
.nem-hero .spacer-80 { height: 28px; }
@media (max-width: 991.98px) {
  section.hero-banner.nem-hero { padding-top: 120px; }
}

/* On a phone the region buttons scroll sideways in one row instead of
   wrapping onto four lines above the chart. */
@media (max-width: 575.98px) {
  .nem-region-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }
  .nem-region-links::-webkit-scrollbar { display: none; }
  .nem-region-links a { flex: 0 0 auto; white-space: nowrap; }
}

/* FCAS page: the ten-by-five price table, and the glossary. */
.nem-fcas-table td { line-height: 1.25; }
.nem-fcas-table thead a { color: inherit; text-decoration: none; }
.nem-fcas-table thead a:hover { text-decoration: underline; }
.nem-fcas-now { display: block; font-weight: 600; color: var(--heading-color-3); }
.nem-fcas-day { display: block; font-size: 11px; color: #6b7280; }
.nem-fcas-high .nem-fcas-now { color: #b42318; }
.nem-fcas-group th {
  background: #f6f8f9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
}

.nem-glossary-index { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.nem-glossary { margin: 0; }
.nem-glossary > div { padding: 14px 0; border-top: 1px solid #e5e7eb; scroll-margin-top: 110px; }
.nem-glossary dt { font-weight: 600; color: var(--heading-color-3); margin-bottom: 4px; }
.nem-glossary dd { margin: 0; }
.nem-glossary dd p:last-child { margin-bottom: 0; }
.nem-glossary > div:target { background: #f3f8f0; }
.nem-fcas-table tbody th[scope="row"], .nem-fcas-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}
.nem-tab[data-market] { --region-color: var(--heading-color-3); }

/* BESS revenue calculator. */
.nem-form { display: flex; flex-direction: column; gap: 14px; }
.nem-field { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.nem-field label, .nem-field legend { font-size: 14px; font-weight: 600; color: var(--heading-color-3); margin: 0; }
.nem-field small { font-size: 12px; color: #6b7280; line-height: 1.35; }
.nem-field select, .nem-input-unit input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 7px 10px;
  font: inherit;
  font-size: 15px;
  color: var(--heading-color-3);
  background: #fff;
}
.nem-field select:focus, .nem-input-unit input:focus { outline: 2px solid var(--heading-color-1); outline-offset: 1px; border-color: transparent; }
.nem-input-unit { display: flex; align-items: center; gap: 8px; }
.nem-input-unit span { font-size: 14px; color: #6b7280; min-width: 2.5em; }
.nem-check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.nem-check input { width: 16px; height: 16px; accent-color: var(--heading-color-2); }
.nem-error { color: #b42318; font-size: 14px; }
.nem-bess-facts dd { font-size: 22px; }
.nem-bess-facts div:first-child dd { color: var(--heading-color-1); font-size: 26px; }
.nem-bar-energy { fill: var(--heading-color-2); }
.nem-bar-fcas { fill: var(--heading-color-1); }
.nem-bess-bar:focus { outline: none; }
.nem-bess-bar:focus rect, .nem-bess-bar:hover rect { opacity: .8; }
.nem-legend .nem-key-energy { background: var(--heading-color-2); }
.nem-legend .nem-key-fcas { background: var(--heading-color-1); }
.nem-cta-panel { border-left: 4px solid var(--heading-color-1); }
.nem-cta-panel p { margin-bottom: 16px; }

/* Monthly reports. */
.nem-report-pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 500; }

/* LGC and STC page: series colours for the build-time stacked bar charts. */
.nem-cert-chart .nem-s1, .nem-legend .nem-s1 { fill: #0a4a56; background: #0a4a56; }
.nem-cert-chart .nem-s2, .nem-legend .nem-s2 { fill: #e0a31f; background: #e0a31f; }
.nem-cert-chart .nem-s3, .nem-legend .nem-s3 { fill: #1f6fb2; background: #1f6fb2; }
.nem-cert-chart .nem-s4, .nem-legend .nem-s4 { fill: #6eb450; background: #6eb450; }
.nem-cert-chart .nem-s5, .nem-legend .nem-s5 { fill: #8a2846; background: #8a2846; }
.nem-cert-chart .nem-s6, .nem-legend .nem-s6 { fill: #9aa3ad; background: #9aa3ad; }
.nem-cert-chart .nem-s7, .nem-legend .nem-s7 { fill: #d27a1f; background: #d27a1f; }
.nem-legend .nem-key { width: 12px; height: 12px; border-radius: 2px; }
.nem-cert-chart g:hover rect { opacity: .8; }
.nem-cert-chart .nem-ref { stroke: #b42318; stroke-width: 1.5; stroke-dasharray: 6 4; }
.nem-legend .nem-key-ref { width: 16px; height: 0; border-top: 2px dashed #b42318; background: none; border-radius: 0; }
.nem-cert-facts div, .nem-cert-prices div { --region-color: var(--heading-color-1); }
.nem-cert-facts small, .nem-cert-prices small { display: block; font-size: 13px; color: #6b7280; }
.nem-cert-prices dd { font-size: 26px; }
.nem-cert-numbers { margin-top: 12px; font-size: 14px; }
.nem-cert-numbers summary { cursor: pointer; color: var(--heading-color-2); font-weight: 500; }
.nem-cert-numbers table { margin-top: 8px; }
.nem-cert-numbers caption { caption-side: top; font-size: 13px; color: #6b7280; }
@media (max-width: 575.98px) {
  .nem-cert-chart .axis { font-size: 20px; }
}
