/* Wattly — layered on PicoCSS v2. Colour tokens first, light then dark. */
:root {
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6b6a66;
  --grid: #e4e3df;
  /* Price bands: a blue-grey-orange diverging scale (deeper blue = cheaper),
     chosen so the four bands stay distinct with red-green colour blindness. */
  --band-neg: #0d366b;
  --band-cheap: #2a78d6;
  --band-normal: #898781;
  --band-exp: #d95926;
  --series: #2a78d6;
  --go-night: #4a3aa7;
  --error: #c02f2f;
  --line-export: #7b3fa0;
  --win-hit: #2a78d6;
  --win-miss: #cfcdc6;
  --now-line: #0b0b0b;
  --div-low: #1c5cab;
  --div-mid: #f0efec;
  --div-high: #c02f2f;
  --highlight: #eb6834;
  --carbon: #1f8a5b;
  --agile: #c2367a;
  --row-selected: #e3eefb;
  --card-tint: #f2f6fc;
  --card-edge: #c9d6e8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #a3a29a;
    --grid: #33332f;
    --band-neg: #2a78d6;
    --band-cheap: #86b6ef;
    --band-normal: #898781;
    --band-exp: #eb6834;
    --series: #3987e5;
    --go-night: #f2d36b;
    --error: #e66767;
    --line-export: #f2d36b;
    --win-hit: #3987e5;
    --win-miss: #4a4a45;
    --now-line: #ffffff;
    --div-low: #3987e5;
    --div-mid: #383835;
    --div-high: #e66767;
    --highlight: #d95926;
    --carbon: #4cc38a;
    --agile: #e05c98;
    --row-selected: #1d3550;
    --card-tint: #1f2731;
    --card-edge: #34445a;
  }
}
:root[data-theme="dark"] {
  --surface-1: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #a3a29a;
  --grid: #33332f;
  --band-neg: #2a78d6;
  --band-cheap: #86b6ef;
  --band-normal: #898781;
  --band-exp: #eb6834;
  --series: #3987e5;
  --go-night: #f2d36b;
  --line-export: #f2d36b;
  --win-hit: #3987e5;
  --win-miss: #4a4a45;
  --now-line: #ffffff;
  --div-low: #3987e5;
  --div-mid: #383835;
  --div-high: #e66767;
  --highlight: #d95926;
  --carbon: #4cc38a;
  --agile: #e05c98;
  --row-selected: #1d3550;
  --card-tint: #1f2731;
  --card-edge: #34445a;
}

body { background: var(--pico-background-color, var(--surface-1)); }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; z-index: 10; padding: .5rem 1rem; background: var(--pico-primary-background); color: var(--pico-primary-inverse); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { padding-top: .5rem; padding-bottom: 0; }
.site-header nav { flex-wrap: wrap; }
.site-header .brand { font-size: 1.1rem; }
.site-header .tagline { margin: -.6rem 0 0; font-size: .8rem; color: var(--text-secondary); line-height: 1.3; }
.header-controls select { margin-bottom: 0; min-width: 0; max-width: 18rem; padding-top: .35rem; padding-bottom: .35rem; }
.theme-toggle { margin-bottom: 0; padding: .35rem .5rem; min-width: 2.3rem; line-height: 1; }
.theme-toggle svg { display: block; margin: 0 auto; }
.page-nav ul { flex-wrap: wrap; gap: 0; margin-left: -.75rem; }
.page-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: .3em; }
.site-footer { color: var(--text-muted); padding-top: 1rem; }

.page-title { margin-bottom: 1rem; font-size: 1.6rem; }
.page-title small { font-size: 1rem; font-weight: 400; }
.muted { color: var(--text-muted); }
.note { color: var(--text-secondary); font-size: .9rem; }
.error { color: var(--error); font-weight: 600; }
.alerts-form { max-width: 32rem; }
.alert-mode label { margin-bottom: .5rem; }
.alert-mode .alert-price { margin: .25rem 0 0 1.9rem; }
.alert-mode .alert-price input { max-width: 8rem; margin: .25rem 0 0; }
.alert-mode small { display: block; margin-left: 1.9rem; color: var(--text-secondary); }
section { margin-bottom: 2rem; }

/* Price cards */
.now-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.price-card { border-left: 8px solid var(--grid); margin-bottom: 1rem; }
.price-card.single { max-width: 24rem; }
.price-card header { font-weight: 600; margin-bottom: .5rem; }
.big-price { font-size: clamp(2.4rem, 9vw, 3.4rem); font-weight: 700; line-height: 1.1; margin: 0; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.big-price .unit { font-size: .45em; font-weight: 500; color: var(--text-secondary); margin-left: .15em; }
.band-label { margin: .25rem 0 0; font-weight: 600; color: var(--text-secondary); }
.band-label::before { content: ""; display: inline-block; width: .75em; height: .75em; border-radius: 2px; margin-right: .4em; vertical-align: -.05em; background: var(--band-color, transparent); }
.band-neg { --band-color: var(--band-neg); }
.band-cheap { --band-color: var(--band-cheap); }
.band-normal { --band-color: var(--band-normal); }
.band-exp { --band-color: var(--band-exp); }
.price-card.band-neg, .price-card.band-cheap, .price-card.band-normal, .price-card.band-exp { border-left-color: var(--band-color); }

/* Inline band chip used in tables/lists */
/* A soft pill tinted with the band colour, so a column of prices reads at a glance. */
.chip { display: inline-block; min-width: 5.2em; padding: .05em .5em; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--band-color, transparent) 15%, transparent); }
.chip::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 2px; margin-right: .35em; background: var(--band-color, transparent); }

/* Charts */
.chart-box { position: relative; height: 260px; width: 100%; }
.chart-tall { height: 320px; }
/* Grid page strip: aligned rows sharing one timeline, with one readout. */
.grid-strip { margin: .5rem 0 1rem; }
.strip-readout { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem .75rem; margin: 0 0 .75rem;
  padding: .6rem .9rem; background: var(--pico-card-background-color); border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow); position: sticky; top: 0; z-index: 2; }
.strip-readout .strip-when { grid-column: 1 / -1; display: flex; align-items: baseline; gap: .5rem; }
.strip-readout dt { font-size: .75rem; color: var(--text-secondary); font-weight: 400; white-space: nowrap; }
.strip-readout dt .swatch { width: .6rem; height: .6rem; margin-right: .25rem; }
.strip-readout dd { margin: 0; font-size: 1.05rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip-readout .unit { font-size: .75em; font-weight: 400; color: var(--text-muted); margin-left: .1em; }
.strip-row + .strip-row { margin-top: .35rem; }
.strip-label { margin: 0; font-size: .85rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
.strip-label .unit { color: var(--text-muted); font-size: .9em; }
.strip-legend { margin: 0; font-size: .8rem; }
.strip-chart { position: relative; height: 90px; width: 100%; }
.strip-chart-tall { height: 120px; }
.strip-chart-last { height: 115px; } /* room for the time axis */
@media (max-width: 1100px) {
  .strip-readout { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .strip-readout { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .5rem .6rem; }
  .strip-readout dd { font-size: .95rem; }
}
.chart-regions { height: 460px; }
/* Touch screens: the picked point's details sit above the chart (app.js). The
   height is reserved so the chart doesn't jump as the number of lines changes. */
.chart-readout { min-height: 4.4rem; margin: 0 0 .4rem; padding: .45rem .7rem; font-size: .85rem; line-height: 1.4;
  background: var(--pico-card-background-color); border-radius: var(--pico-border-radius); box-shadow: var(--pico-card-box-shadow);
  font-variant-numeric: tabular-nums; }
.chart-readout p { margin: 0; }
.chart-readout .title { font-weight: 600; color: var(--text-primary); }
.chart-readout .hint { color: var(--text-muted); }
.chart-readout ul { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0; padding: 0; }
.chart-readout li { list-style: none; margin: 0; color: var(--text-secondary); }
.chart-readout .sw { display: inline-block; width: .7em; height: .7em; border-radius: 2px; margin-right: .35em; vertical-align: -.02em; }
@media (min-width: 768px) {
  .chart-box { height: 300px; }
  .chart-tall { height: 380px; }
}
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--text-secondary); margin: .5rem 0; }
.legend .sw { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: .35em; vertical-align: -.05em; }
.sw.band-neg { background: var(--band-neg); } .sw.band-cheap { background: var(--band-cheap); }
.sw.band-normal { background: var(--band-normal); } .sw.band-exp { background: var(--band-exp); }
.sw.line-export { background: var(--line-export); height: 3px; vertical-align: .2em; width: 1.2em; }
.sw.line-go-agile, .sw.line-go-rest, .sw.line-go-night, .sw.line-go-day { height: 3px; vertical-align: .2em; width: 1.2em; }
.sw.line-go-agile { background: var(--series); } .sw.line-go-rest { background: var(--text-muted); }
.sw.line-go-night { background: repeating-linear-gradient(90deg, var(--go-night) 0 4px, transparent 4px 7px); }
.sw.line-go-day { background: repeating-linear-gradient(90deg, var(--highlight) 0 4px, transparent 4px 7px); }
.sw.win-hit { background: var(--win-hit); } .sw.win-miss { background: var(--win-miss); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.table-scroll table { font-variant-numeric: tabular-nums; font-size: .9rem; }
.table-scroll td, .table-scroll th { white-space: nowrap; }
details summary { font-size: .9rem; }

.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.stat-list > div { background: var(--pico-card-background-color); border-radius: var(--pico-border-radius); padding: .6rem .8rem; box-shadow: var(--pico-card-box-shadow); }
.stat-list dt { font-size: .8rem; color: var(--text-secondary); font-weight: 400; }
.stat-list dd { margin: 0; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-list dd small { display: block; font-size: .8rem; font-weight: 400; }
.go-rates input { width: 9rem; }

.window-list { padding-left: 1.4rem; }
.window-list li { margin-bottom: .5rem; }
/* Home page: time on the left, its average on the right. */
#best-windows { list-style: none; padding-left: 0; }
#best-windows li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .2rem .75rem;
  margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--grid); list-style: none; }
#best-windows .avg { margin-left: auto; white-space: nowrap; }
#best-windows .avg small { color: var(--text-muted); }
.window-list .when { font-weight: 600; }
.window-list .avg { font-variant-numeric: tabular-nums; }

.two-col { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }

/* Filter rows */
/* Filter rows: inputs, selects and button groups share one compact height so they line up. */
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; margin-bottom: 1rem;
  --pico-form-element-spacing-vertical: .45rem; --pico-form-element-spacing-horizontal: .8rem;
  --filter-h: calc(.9rem * var(--pico-line-height) + .9rem + var(--pico-border-width) * 2); }
.filter-row label { margin-bottom: 0; font-size: .9rem; }
.filter-row input, .filter-row select { margin-bottom: 0; font-size: .9rem; height: var(--filter-h); }
.filter-row select { padding-right: calc(var(--pico-form-element-spacing-horizontal) + 1.5rem); }
.filter-row fieldset[role="group"] { margin-bottom: 0; width: auto; }
.filter-row fieldset[role="group"] button { height: var(--filter-h); padding: 0 .8rem; font-size: .9rem; white-space: nowrap; }
button[aria-pressed="true"] { --pico-background-color: var(--pico-primary-background); --pico-color: var(--pico-primary-inverse); }
button[aria-pressed="false"] { --pico-background-color: transparent; --pico-color: var(--pico-primary); }

/* Heatmap */
.heatmap-wrap { position: relative; width: 100%; }
#heatmap { width: 100%; display: block; touch-action: pan-y; }
.chart-tip { position: absolute; pointer-events: none; background: var(--pico-card-background-color); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: .3rem .5rem; font-size: .8rem; box-shadow: var(--pico-card-box-shadow); white-space: nowrap; z-index: 2; }
.heat-scale { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-secondary); margin-top: .5rem; }
.heat-scale .bar { flex: 0 1 14rem; height: .7rem; border-radius: 2px; }

/* Blog */
.post-list { list-style: none; padding-left: 0; }
.post-list li { list-style: none; margin-bottom: 1.5rem; }
.post-list small { display: block; }
.post-list p { margin: .25rem 0 0; color: var(--text-secondary); }
.post { max-width: 46rem; }
.post-body h2, .post-body h3 { margin-top: 2rem; }
.post-body .table-scroll td, .post-body .table-scroll th { white-space: normal; }
.post-body blockquote { color: var(--text-secondary); }
.post-sources { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--grid); font-size: .9rem; }
.post-sources h2 { font-size: 1.1rem; }

@media (max-width: 575px) {
  .site-header nav { gap: .25rem; }
  .site-header nav > ul:first-child { flex-shrink: 0; }
  .header-controls { min-width: 0; flex-shrink: 1; }
  .header-controls li:first-child { min-width: 0; }
  .header-controls select { max-width: 11rem; }
  .theme-toggle { flex-shrink: 0; }
  /* One row of page links that scrolls sideways, instead of three ragged rows;
     the fade on the right shows there's more. */
  .page-nav { overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--pico-spacing));
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .page-nav::-webkit-scrollbar { display: none; }
  .page-nav ul { flex-wrap: nowrap; margin-left: -.5rem; padding-right: 2rem; }
  .page-nav li a { padding: .35rem .5rem; font-size: .9rem; white-space: nowrap; }
  /* Tighter headings and spacing on phones, so a screen holds more than a title. */
  main h2 { font-size: 1.35rem; margin-bottom: .6rem; }
  .page-title { font-size: 1.4rem; margin-bottom: .75rem; }
  section { margin-bottom: 1.75rem; }
  .wide-only { display: none; }
  .slots-table th, .slots-table td { padding-left: .4rem; padding-right: .4rem; font-size: .85rem; }
  .slots-table .chip { min-width: 0; }
  /* The two price cards sit side by side. */
  .now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .now-grid .price-card { padding: .7rem .8rem; border-left-width: 6px; }
  .now-grid .price-card header { margin: -.7rem -.8rem .5rem; padding: .5rem .8rem; font-size: .85rem; line-height: 1.3; }
  .now-grid .price-card header .muted { display: block; }
  .now-grid .big-price { font-size: 2.3rem; }
  .now-grid .big-price .unit { display: block; margin: 0; font-size: .8rem; }
  .now-grid .band-label { font-size: .9rem; }
}

/* Links to every region's price page (home and agile/<region>). */
.region-links { columns: 3 11rem; column-gap: 1.5rem; padding-left: 0; list-style: none; }
.region-links li { list-style: none; margin-bottom: .35rem; break-inside: avoid; }
.region-links a[aria-current="page"] { font-weight: 700; text-decoration: none; }

/* Postcode -> region finder */
.postcode-finder { margin: 0 0 1rem; }
.postcode-finder form { margin: 0; }
.postcode-finder label { color: var(--text-secondary); font-size: .9rem; margin-bottom: .25rem; }
.postcode-row { display: flex; gap: .5rem; align-items: stretch; }
.postcode-row input, .postcode-row button { margin: 0; width: auto; font-size: .9rem; padding-top: .45rem; padding-bottom: .45rem; height: auto; }
.postcode-row input { flex: 0 1 9rem; min-width: 6rem; text-transform: uppercase; }
.postcode-row button { white-space: nowrap; }
.postcode-finder input::placeholder { text-transform: none; }
.postcode-finder .note { margin: .4rem 0 0; }
.postcode-finder .note:empty { display: none; }

.install-app { display: block; margin-top: .75rem; padding: .35rem .8rem; font-size: .85rem; width: auto; }

/* Chart extras: price cap reference, carbon line, typical-home series */
.sw.line-cap { height: 0; border-top: 2px dashed var(--text-secondary); background: none; vertical-align: .25em; width: 1.2em; border-radius: 0; }
.sw.line-carbon { height: 3px; vertical-align: .2em; width: 1.2em; background: var(--carbon); }
.sw.line-typical { height: 3px; vertical-align: .2em; width: 1.2em; background: var(--highlight); }
.chart-toggles { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .25rem 0 .5rem; font-size: .9rem; }
.chart-toggles label { margin-bottom: 0; }

/* Negative prices page */
.stat-list dd .sub { display: block; font-size: .8rem; font-weight: 400; color: var(--text-secondary); }
.neg-latest { font-size: 1.05rem; }

/* Appliance planner */
.appliances { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.appliance { margin: 0; padding: .8rem 1rem; background: var(--card-tint); border: 1px solid var(--card-edge); border-top: 4px solid var(--series); box-shadow: none; }
.appliance .chip { min-width: 0; }
.appliance header { margin: 0 0 .35rem; padding: 0; background: none; border: 0; font-weight: 600; }
.appliance header small { display: block; font-weight: 400; color: var(--text-secondary); }
.appliance .best { font-size: 1.05rem; font-weight: 600; margin: .1rem 0 0; color: var(--series); }
.appliance .timer { margin: .2rem 0 0; font-variant-numeric: tabular-nums; }
.appliance .cost { margin: .2rem 0 0; color: var(--text-secondary); font-size: .9rem; }
.appliance .actions { display: flex; gap: .4rem; margin-top: .5rem; }
.appliance .actions button { padding: .2rem .55rem; font-size: .8rem; margin: 0; width: auto; }
.appliance-form { margin-bottom: 1rem; }
.window-list .extra { color: var(--text-secondary); font-size: .9rem; }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; } .actions-row button { width: auto; }

/* Data credits and attributions: kept small and out of the way. */
.credit, .site-footer small { font-size: .68rem; }

/* A highlighted table row: your region, the current half-hour, a found window. */
tr.row-selected > th, tr.row-selected > td { background-color: var(--row-selected); font-weight: 600; }
tr.row-selected > :first-child { box-shadow: inset 4px 0 0 var(--highlight); }

/* Disclosure toggles ("Show as table", "Add an appliance") look like buttons.
   They stay <details>/<summary>, which keyboards and screen readers already treat
   as an expand/collapse button. */
details.toggle-button { border: 0; padding: 0; margin: .5rem 0 1rem; }
details.toggle-button > summary {
  display: inline-block; width: auto; list-style: none; cursor: pointer;
  padding: .35rem .9rem; font-size: .85rem; line-height: 1.4;
  color: var(--pico-secondary); border: var(--pico-border-width) solid var(--pico-secondary-border, currentColor);
  border-radius: var(--pico-border-radius); background: transparent; margin-bottom: .5rem;
}
details.toggle-button > summary::-webkit-details-marker { display: none; }
details.toggle-button > summary::after { display: none; }
details.toggle-button > summary:hover { color: var(--pico-secondary-hover); border-color: var(--pico-secondary-hover); }
details.toggle-button > summary:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 2px; }
details.toggle-button .when-open, details.toggle-button[open] .when-closed { display: none; }
details.toggle-button[open] .when-open { display: inline; }

/* A thin divider between page links. */
/* Each link has the same padding on both sides, so the gaps either side of a
   divider match. */
.page-nav li { display: flex; align-items: center; padding: 0; }
.page-nav li a { margin: 0; padding: .4rem .75rem; }
.page-nav li + li::before { content: ""; display: block; width: 1px; height: 1em; background: var(--text-muted); opacity: .45; }

/* Site map page */
.site-map dt { margin-top: 1rem; font-weight: 600; }
.site-map dd { margin: .2rem 0 0; color: var(--text-secondary); }
.site-map-posts { padding-left: 1.2rem; }
.site-map-posts li { margin-bottom: .5rem; }

/* Year links on the year-of-prices pages */
.year-links { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: .25rem .9rem; margin: -.25rem 0 1.25rem; }
.year-links a[aria-current="page"] { font-weight: 700; text-decoration: none; }

/* Region facts and common questions on the price pages */
.glance dd { font-size: 1.1rem; }
.faq h3 { font-size: 1.05rem; margin: 1.25rem 0 .35rem; }
.faq p { margin-bottom: .5rem; }
.page-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .25rem 0 1rem; }

/* Live grid (grid.php). Source colours are grouped by family (fossil, renewable,
   other) and validated for CVD separation in both orders they're drawn in: the
   donut (gas, oil, hydro, solar, wind, biomass, nuclear, round the circle) and the
   generation chart (nuclear, biomass, wind, solar, hydro, gas, oil, bottom up).
   Group bands carry white text (>= 4.9:1); the donut's inner ring uses the same
   hues, stepped lighter in dark mode. */
:root {
  --src-gas: #eb6834; --src-oil: #4a3aa7; --src-hydro: #1baf7a; --src-solar: #eda100;
  --src-wind: #008300; --src-biomass: #e87ba4; --src-nuclear: #2a78d6;
  --grp-fossils: #a8461a; --grp-renewables: #1d7f5a; --grp-others: #4b40b0; --grp-transfers: #5c5b57;
  --ring-fossils: #a8461a; --ring-renewables: #1d7f5a; --ring-others: #4b40b0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --src-gas: #d95926; --src-oil: #9085e9; --src-hydro: #199e70; --src-solar: #c98500;
    --src-wind: #008300; --src-biomass: #d55181; --src-nuclear: #3987e5;
    --ring-fossils: #d95926; --ring-renewables: #22a06b; --ring-others: #8478e6;
  }
}
:root[data-theme="dark"] {
  --src-gas: #d95926; --src-oil: #9085e9; --src-hydro: #199e70; --src-solar: #c98500;
  --src-wind: #008300; --src-biomass: #d55181; --src-nuclear: #3987e5;
  --ring-fossils: #d95926; --ring-renewables: #22a06b; --ring-others: #8478e6;
}

.grid-top { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1rem; margin-bottom: 1.5rem; }
.grid-top .note { grid-column: 1 / -1; margin: -.25rem 0 0; }
.grid-card { display: flex; justify-content: space-around; align-items: center; gap: .5rem; margin: 0;
  background: var(--pico-card-background-color); border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow); padding: .9rem 1rem; text-align: center; }
.grid-card dt { font-size: .85rem; color: var(--text-secondary); font-weight: 400; }
.grid-card dd { margin: 0; font-size: 1.6rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.grid-card .unit { font-size: .55em; font-weight: 400; color: var(--text-muted); margin-left: .1em; }
.grid-equation .op { font-size: 1.4rem; color: var(--text-muted); padding-top: 1.1rem; }

.grid-mix { display: grid; grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr); gap: 1rem; align-items: start; }
.mix-donut { margin: 0; align-self: center; }
.mix-donut svg { width: 100%; height: auto; display: block; }
.mix-group { width: 100%; margin-bottom: .75rem; font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0; }
.mix-group th, .mix-group td { padding: .28rem .35rem; border-bottom: 1px solid var(--grid); font-size: .9rem; background: transparent; }
.mix-group tbody th { font-weight: 400; width: 100%; white-space: nowrap; }
.mix-group .num { text-align: right; white-space: nowrap; }
.mix-group .unit { font-size: .8em; opacity: .8; margin-left: .1em; }
.mix-group .band th { color: #fff; font-weight: 600; border: 0; }
.mix-group .band th:first-child { border-radius: var(--pico-border-radius) 0 0 var(--pico-border-radius); }
.mix-group .band th:last-child { border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0; }
.band-fossils th { background: var(--grp-fossils); }
.band-renewables th { background: var(--grp-renewables); }
.band-others th { background: var(--grp-others); }
.band-interconnectors th, .band-storage th { background: var(--grp-transfers); }
.spark-cell { white-space: nowrap; width: 1%; }
.swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; background: var(--c); vertical-align: middle; margin-right: .35rem; }
.spark { width: 56px; height: 20px; vertical-align: middle; overflow: visible; }
.spark .zero { stroke: var(--grid); stroke-width: 1; }
.donut-centre { fill: var(--text-primary); }
.donut-centre .muted { fill: var(--text-secondary); }
.grid-credits { margin-top: 1rem; }

@media (max-width: 960px) {
  .grid-mix { grid-template-columns: 1fr 1fr; }
  .mix-donut { grid-column: 1 / -1; grid-row: 1; max-width: 300px; justify-self: center; width: 100%; }
}
@media (max-width: 720px) {
  .grid-top { grid-template-columns: 1fr; }
  .grid-mix { grid-template-columns: 1fr; }
  .grid-card dd { font-size: 1.3rem; }
  .grid-equation .op { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  #grid-period button { padding: 0 .35rem; font-size: .82rem; }
  .grid-card { padding: .75rem .5rem; }
  .grid-card dd { font-size: 1.1rem; }
  .spark { width: 48px; }
}

/* Agile price widget page (embed.php) */
.embed-form { align-items: end; }
.embed-grid { align-items: start; }
.embed-grid textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
