GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Solar and storage design / globalgrid2050 / solar-bess-topology-v6/module-layout

Module Layout V5 and 4 more files (part 2)

A style sheet in GlobalGrid2050. Served with the page at https://globalgrid2050.com/solar-bess-topology-v6/module-layout/.

564 lines of CSS and YAML from globalgrid2050, in 5 files. Topic: Solar and storage design. Section 96 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Module Layout V5 render · globalgrid2050 / solar-bess-topology-v6/module-layout/module-layout-v5.css lines 449–781
  2. Manifest test · globalgrid2050 / solar-bess-topology-v6/upgrades/000_validation_test/manifest.yml lines 1–11
  3. Manifest test · globalgrid2050 / solar-bess-topology-v6/upgrades/001_gis_sld_validation_test/manifest.yml lines 1–11
  4. Manifest docs-config · globalgrid2050 / solar-bess-topology-v6/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml lines 1–66
  5. Manifest docs-config · globalgrid2050 / solar-bess-topology-v6/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml lines 1–143

Module Layout V5

A style sheet in GlobalGrid2050. Served with the page at https://globalgrid2050.com/solar-bess-topology-v6/module-layout/.

renderglobalgrid2050 / solar-bess-topology-v6/module-layout/module-layout-v5.css · lines 449–781 of 781 (continued from section 95) · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Downstream impact
Used directly by 3 files: Solar Battery Energy Storage System (BESS) Topology V6 — Module Layout Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v6/module-layout/); Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/module-layout/); Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page (globalgrid2050, https://globalgrid2050.com/testcode/202609051958/layer-apps/solar-bess-topology-v7/module-layout/). Reached from 142 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Demonstration Videos (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v6/module-layout/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Loaded by the Module Layout page at https://globalgrid2050.com/solar-bess-topology-v6/module-layout/ and 2 other pages.
Application
globalgrid2050 · solar-bess-topology-v6/module-layout · style sheet
Uses
none found
Used by
loaded by Solar Battery Energy Storage System (BESS) Topology V6 — Module Layout Page (stylesheet), loaded by Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page (stylesheet), loaded by Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page (stylesheet)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v6/module-layout/module-layout-v5.css:449-781 · blob 813895d3d958eac0af6b695f8af522c9b879e5b4 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
  span,
  small,
  strong,
  li {
    color: #111111 !important;
  }

  input,
  select,
  textarea {
    color: #111111 !important;
    background: #ffffff !important;
    border: 1px solid #999999 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .input-group,
  .module-stat,
  .stat-row,
  .summary-row,
  .function-item,
  .card,
  .topo-mode,
  .tab-content {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .tab-content,
  .topo-mode {
    display: block !important;
  }

  .tab-content:not(.active),
  .topo-mode:not(.active) {
    display: block !important;
  }

  a::after {
    content: "" !important;
  }

  * {
    text-shadow: none !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* GLOBALGRID2050 PRINT V2 COMPACT REPORT MODE */
@media print {
  @page {
    size: A4 portrait;
    margin: 9mm;
  }

  html,
  body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
    background: #fff !important;
    color: #111 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 8.5pt !important;
    line-height: 1.22 !important;
  }

  body::before {
    content: "GlobalGrid2050 Screening Report";
    display: block !important;
    font-weight: 700 !important;
    font-size: 11pt !important;
    color: #111 !important;
    border-bottom: 1px solid #999 !important;
    padding: 0 0 3mm 0 !important;
    margin: 0 0 4mm 0 !important;
  }

  .dashboard,
  .module-app-shell,
  .module-main,
  .topo-main,
  main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    gap: 0 !important;
  }

  header,
  .panel,
  .panel-left,
  .panel-right,
  .module-panel,
  .topo-panel,
  .module-map-card,
  .guidance-box,
  .warning-box,
  .status-box,
  .module-note {
    display: block !important;
    position: static !important;
    inset: auto !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 3.5mm !important;
    margin: 0 0 4mm 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .panel-left,
  .module-panel,
  .topo-panel {
    column-count: 2;
    column-gap: 8mm;
    column-rule: 1px solid #ddd;
  }

  .panel-right,
  .panel-right.map-expanded,
  .panel-right.map-fullscreen,
  .module-map-card {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    z-index: auto !important;
    page-break-before: auto !important;
    break-before: auto !important;
    column-count: initial !important;
    column-gap: initial !important;
    column-rule: none !important;
  }

  #map,
  #module_map {
    display: block !important;
    width: 100% !important;
    height: 125mm !important;
    min-height: 125mm !important;
    max-height: 125mm !important;
    border: 1px solid #999 !important;
    margin: 0 0 3mm 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  canvas,
  svg {
    max-width: 100% !important;
    height: auto !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .maplibregl-canvas,
  .maplibregl-map {
    max-width: 100% !important;
  }

  .map-controls,
  .map-tool-overlay,
  .module-map-toolbar,
  .crosshair,
  #fetch_status,
  .maplibregl-control-container,
  .maplibregl-ctrl,
  .maplibregl-ctrl-group,
  .search-box,
  .button-row,
  .btn,
  button,
  .tab-container,
  .topo-tabs,
  .toolbar,
  .print-btn,
  [id*="btn_"],
  [class*="toggle"] {
    display: none !important;
  }

  .legend {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #ccc !important;
    padding: 2.5mm !important;
    margin: 2mm 0 0 0 !important;
    font-size: 7.5pt !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .legend * {
    color: #111 !important;
  }

  h1 {
    font-size: 14pt !important;
    line-height: 1.15 !important;
    margin: 0 0 3mm 0 !important;
    padding: 0 !important;
  }

  h2 {
    font-size: 10pt !important;
    line-height: 1.15 !important;
    margin: 2.5mm 0 1.5mm 0 !important;
    padding: 0 0 1mm 0 !important;
    border-bottom: 1px solid #999 !important;
    color: #111 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  h3 {
    font-size: 8.5pt !important;
    line-height: 1.15 !important;
    margin: 2mm 0 1mm 0 !important;
    padding: 0 0 0.75mm 0 !important;
    border-bottom: 1px dotted #bbb !important;
    color: #111 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  p,
  label,
  div,
  span,
  small,
  strong,
  li {
    color: #111 !important;
  }

  p {
    margin: 0 0 2mm 0 !important;
  }

  .input-group,
  .module-stat,
  .stat-row,
  .summary-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 2mm !important;
    align-items: baseline !important;
    margin: 0 0 1mm 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  input,
  select,
  textarea {
    color: #111 !important;
    background: #fff !important;
    border: none !important;
    border-bottom: 1px solid #aaa !important;
    padding: 0 !important;
    min-height: 0 !important;
    font-size: 8.5pt !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .tab-content,
  .topo-mode {
    display: none !important;
  }

  .tab-content.active,
  .topo-mode.active,
  .topo-mode[data-mode-panel].active {
    display: block !important;
  }

  details:not([open]) {
    display: none !important;
  }

  .collapsed,
  .hidden,
  [hidden] {
    display: none !important;
  }

  .warning,
  .notice,
  .guidance-box,
  .warning-box,
  .status-box,
  .module-note {
    font-size: 8pt !important;
    line-height: 1.2 !important;
  }

  a::after {
    content: "" !important;
  }

  * {
    text-shadow: none !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that tests solar and battery storage (BESS).

testglobalgrid2050 / solar-bess-topology-v6/upgrades/000_validation_test/manifest.yml · lines 1–11 of 11 · Not reached from any entry point (candidate for review)

What it does
It tests solar and battery storage (BESS).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS).
What it achieves
Validation only manifest for the V6 Complex Upgrade Install workflow.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v6/upgrades/000_validation_test · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v6/upgrades/000_validation_test/manifest.yml:1-11 · blob 94d0c066aa604bf81308d2d1cac9c9ec9a25fa73 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 000_validation_test
target_app: docs
description: Validation only manifest for the V6 Complex Upgrade Install workflow.
allowed_paths:
  - solar-bess-topology-v6/docs
operations: []
checks:
  - manifest_read
  - target_app_validated
  - allowed_paths_validated
  - report_written

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that tests solar and battery storage (BESS).

testglobalgrid2050 / solar-bess-topology-v6/upgrades/001_gis_sld_validation_test/manifest.yml · lines 1–11 of 11 · Not reached from any entry point (candidate for review)

What it does
It tests solar and battery storage (BESS).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS).
What it achieves
Validation only manifest for the V6 GIS single-line diagram (SLD) Financial Sandbox.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v6/upgrades/001_gis_sld_validation_test · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v6/upgrades/001_gis_sld_validation_test/manifest.yml:1-11 · blob a1c1cbe924d916484787df3a9caf7f7a4c41d161 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 001_gis_sld_validation_test
target_app: gis-sld-financial-sandbox
description: Validation only manifest for the V6 GIS SLD Financial Sandbox.
allowed_paths:
  - solar-bess-topology-v6/gis-sld-financial-sandbox
operations: []
checks:
  - manifest_read
  - target_app_validated
  - allowed_paths_validated
  - report_written

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that maps atlas grid 132kV line, atlas grid 400kV line, l sat and solar.

docs-configglobalgrid2050 / solar-bess-topology-v6/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml · lines 1–66 of 66 · Not reached from any entry point (candidate for review)

What it does
It maps atlas grid 132kV line, atlas grid 400kV line, l sat and solar.
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, 400kV, 132kV.
Inputs & outputs
Voltage levels named: 400kV, 132kV.
What it achieves
Add Atlas V8 132kV and 400kV grid line visibility to the V6 GIS single-line diagram (SLD) Financial Sandbox map.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v6/upgrades/002_gis_sld_atlas_v8_132_400kv_layers · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v6/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml:1-66 · blob 96381021b25ebe0a57bc1321c409e09d31c586ea · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 002_gis_sld_atlas_v8_132_400kv_layers
target_app: gis-sld-financial-sandbox
description: Add Atlas V8 132 kV and 400 kV grid line visibility to the V6 GIS SLD Financial Sandbox map.
allowed_paths:
  - solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
operations:
  - type: insert_after
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    marker: '    map.addLayer({ id: "l-sat", type: "raster", source: "sat-s", layout: { visibility: "none" } });'
    insert: |

      // Atlas V8 transmission visibility layers
      // These layers are read from the existing Atlas V8 data folder.
      // They are visual context only and do not imply confirmed grid headroom.
      map.addSource("atlas-v8-grid-132kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_132kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-132kv-line",
          type: "line",
          source: "atlas-v8-grid-132kv",
          layout: { visibility: "visible" },
          paint: {
              "line-color": "#ffcc00",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.0, 10, 1.8, 14, 3.0],
              "line-opacity": 0.72
          }
      });

      map.addSource("atlas-v8-grid-400kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_400kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-400kv-line",
          type: "line",
          source: "atlas-v8-grid-400kv",
          layout: { visibility: "visible" },
          paint: {
              "line-color": "#ff3333",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.6, 10, 2.8, 14, 4.2],
              "line-opacity": 0.82
          }
      });
  - type: replace
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    find: '        <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>'
    replace: |
      <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>
              <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 2px solid #ffcc00;"></div> Atlas V8 132 kV Lines</div>
              <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 3px solid #ff3333;"></div> Atlas V8 400 kV Lines</div>
checks:
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-132kv-line'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-400kv-line'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 132 kV Lines'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 400 kV Lines'

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that maps atlas grid 66kV line, atlas grid 132kV line, atlas grid 275kV line and atlas grid 400kV line.

docs-configglobalgrid2050 / solar-bess-topology-v6/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml · lines 1–143 of 143 · Not reached from any entry point (candidate for review)

What it does
It maps atlas grid 66kV line, atlas grid 132kV line, atlas grid 275kV line and atlas grid 400kV line.
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: 400kV, 275kV, 132kV, 66kV.
Inputs & outputs
Voltage levels named: 400kV, 275kV, 132kV, 66kV.
What it achieves
Add Atlas V8 66kV and 275kV grid line layers and allow Atlas voltage layers to be toggled from the V6 GIS single-line diagram (SLD) map legend.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v6/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v6/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml:1-143 · blob 749419aef7834c2504becee2440cd3e1f134a7ce · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 003_gis_sld_atlas_v8_voltage_layer_toggles
target_app: gis-sld-financial-sandbox
description: Add Atlas V8 66 kV and 275 kV grid line layers and allow Atlas voltage layers to be toggled from the V6 GIS SLD map legend.
allowed_paths:
  - solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
operations:
  - type: insert_after
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    marker: 'let map = null;'
    insert: |

      const atlasV8GridLayerVisibility = {
          "66kv": true,
          "132kv": true,
          "275kv": true,
          "400kv": true
      };

      const atlasV8GridLayerIds = {
          "66kv": "atlas-v8-grid-66kv-line",
          "132kv": "atlas-v8-grid-132kv-line",
          "275kv": "atlas-v8-grid-275kv-line",
          "400kv": "atlas-v8-grid-400kv-line"
      };

      function toggleAtlasV8GridLayer(voltageKey) {
          if (!atlasV8GridLayerIds[voltageKey]) return;
          atlasV8GridLayerVisibility[voltageKey] = !atlasV8GridLayerVisibility[voltageKey];
          const layerId = atlasV8GridLayerIds[voltageKey];
          if (map && map.getLayer(layerId)) {
              map.setLayoutProperty(layerId, "visibility", atlasV8GridLayerVisibility[voltageKey] ? "visible" : "none");
          }
          updateLegend();
      }
  - type: regex_replace
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    flags: s
    pattern: '// Atlas V8 transmission visibility layers.*?map\.addLayer\(\{\n    id: "atlas-v8-grid-400kv-line",\n    type: "line",\n    source: "atlas-v8-grid-400kv",\n    layout: \{ visibility: "visible" \},\n    paint: \{\n        "line-color": "#ff3333",\n        "line-width": \["interpolate", \["linear"\], \["zoom"\], 5, 1\.6, 10, 2\.8, 14, 4\.2\],\n        "line-opacity": 0\.82\n    \}\n\}\  … [line shortened here: 403 characters; full line on GitHub]
    replace: |
      // Atlas V8 transmission visibility layers
      // These layers are read from the existing Atlas V8 data folder.
      // They are visual context only and do not imply confirmed grid headroom.
      map.addSource("atlas-v8-grid-66kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_66kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-66kv-line",
          type: "line",
          source: "atlas-v8-grid-66kv",
          layout: { visibility: atlasV8GridLayerVisibility["66kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#66ff66",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.8, 10, 1.4, 14, 2.4],
              "line-opacity": 0.62
          }
      });

      map.addSource("atlas-v8-grid-132kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_132kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-132kv-line",
          type: "line",
          source: "atlas-v8-grid-132kv",
          layout: { visibility: atlasV8GridLayerVisibility["132kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ffcc00",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.0, 10, 1.8, 14, 3.0],
              "line-opacity": 0.72
          }
      });

      map.addSource("atlas-v8-grid-275kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_275kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-275kv-line",
          type: "line",
          source: "atlas-v8-grid-275kv",
          layout: { visibility: atlasV8GridLayerVisibility["275kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ff66ff",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.3, 10, 2.4, 14, 3.7],
              "line-opacity": 0.76
          }
      });

      map.addSource("atlas-v8-grid-400kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_400kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-400kv-line",
          type: "line",
          source: "atlas-v8-grid-400kv",
          layout: { visibility: atlasV8GridLayerVisibility["400kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ff3333",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.6, 10, 2.8, 14, 4.2],
              "line-opacity": 0.82
          }
      });
  - type: insert_before
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    marker: 'function updateLegend() {'
    insert: |
      function atlasV8LegendItem(voltageKey, label, colour, widthPx) {
          const visible = atlasV8GridLayerVisibility?.[voltageKey] !== false;
          const opacity = visible ? "1" : "0.35";
          const suffix = visible ? "" : " OFF";
          return `<div class="legend-item" onclick="toggleAtlasV8GridLayer('${voltageKey}')" style="cursor:pointer; opacity:${opacity};" title="Tap to toggle ${label}"><div class="swatch" style="background:transparent; border-bottom: ${widthPx}px solid ${colour};"></div> ${label}${suffix}</div>`;
      }

  - type: regex_replace
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    flags: s
    pattern: '<div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>\n        <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 2px solid #ffcc00;"></div> Atlas V8 132 kV Lines</div>\n        <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom  … [line shortened here: 457 characters; full line on GitHub]
    replace: |
      <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>
              ${atlasV8LegendItem("66kv", "Atlas V8 66 kV Lines", "#66ff66", 2)}
              ${atlasV8LegendItem("132kv", "Atlas V8 132 kV Lines", "#ffcc00", 2)}
              ${atlasV8LegendItem("275kv", "Atlas V8 275 kV Lines", "#ff66ff", 3)}
              ${atlasV8LegendItem("400kv", "Atlas V8 400 kV Lines", "#ff3333", 3)}
checks:
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-66kv-line'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-275kv-line'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'toggleAtlasV8GridLayer'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'atlasV8LegendItem'
  - type: assert_contains
    file: solar-bess-topology-v6/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 275 kV Lines'