.circuit-header {
  min-height: 138px;
  padding-block: 11px;
}

.circuit-header .navbar-brand {
  flex-shrink: 0;
}

.header-circuit-menu {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  margin-left: 38px;
  min-height: 116px;
  padding-top: 34px;
}

.header-main-bus {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 42px;
  pointer-events: none;
  z-index: 0;
}

.header-main-bus path {
  fill: none;
  stroke: #c3d7e1;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.3s;
}

.header-main-bus .header-bus-current {
  stroke: #95bd45;
  stroke-width: 2.7;
  stroke-dasharray: 8 88;
  animation: bus-current 4s linear infinite;
}

.header-main-bus .header-drop-current {
  stroke: #8eb643;
  stroke-width: 2.5;
  stroke-dasharray: 5 63;
  animation: drop-current 1.8s linear infinite;
}

.header-main-bus .drop-two {
  animation-delay: -0.45s;
}

.header-main-bus .drop-three {
  animation-delay: -0.9s;
}

.header-main-bus .drop-four {
  animation-delay: -1.35s;
}

.header-bus-junction {
  fill: #fff;
  stroke: #6999b3;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.header-power-source {
  fill: #fff;
  stroke: #78a342;
  stroke-width: 1.3;
}

.header-main-bus .header-power-symbol {
  stroke: #749832;
  stroke-width: 1;
  fill: #eff7dc;
}

.header-power-ring {
  fill: none;
  stroke: #9dbf53;
  stroke-width: 1.5;
  transform-origin: 10px 10px;
  animation: power-source 2.4s ease-out infinite;
}

@keyframes power-source {
  from {
    opacity: 0.6;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes bus-current {
  to {
    stroke-dashoffset: -192;
  }
}

@keyframes drop-current {
  to {
    stroke-dashoffset: -68;
  }
}

.header-circuit-menu:has(.header-circuit-link:hover) .header-main-bus path,
.header-circuit-menu:has(.header-branch[open]) .header-main-bus path,
.header-circuit-menu:has(.is-energized) .header-main-bus path,
.header-circuit-menu:has(.is-current) .header-main-bus path {
  stroke: #a9c465;
}

.header-circuit-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 82px;
  padding: 0 8px 5px;
  background: transparent;
  color: #24445b;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition:
    border-color 0.25s,
    background 0.25s;
}

.header-circuit-link::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid #afcd70;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
}

.header-circuit-link.is-energized::after {
  animation: circuit-confirm 0.5s ease-out;
}

@keyframes circuit-confirm {
  0% {
    opacity: 0.7;
    transform: scale(0.96);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

.header-circuit-link:hover,
.header-circuit-link:focus-visible {
  border-color: #ccdde7;
  background: #f6fafc;
  color: #235c98;
}

.header-circuit-link::-webkit-details-marker {
  display: none;
}

.header-switch {
  display: block;
  width: 39px;
  height: 28px;
  flex-shrink: 0;
  fill: none;
}

.header-switch-main {
  width: 40px;
  height: 52px;
  background: #fff;
  border-radius: 3px;
}

.header-switch-main .header-switch-blade {
  transform-origin: 20px 36px;
  transform: rotate(-32deg);
}

.header-led-halo {
  fill: #a5c950;
  opacity: 0;
}

.header-circuit-link:hover .header-led-halo,
.header-circuit-link:focus-visible .header-led-halo,
.header-branch[open] > summary .header-led-halo,
.header-circuit-link.is-energized .header-led-halo,
.header-circuit-link.is-current .header-led-halo {
  animation: led-halo 1.8s ease-in-out infinite;
}

@keyframes led-halo {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.35;
  }
}

.header-circuit-link:hover .header-wire-in,
.header-circuit-link:focus-visible .header-wire-in,
.header-sector-link:hover .header-wire-in,
.header-sector-link:focus-visible .header-wire-in {
  stroke: #8caa38;
  stroke-dasharray: 3 2;
  animation: wire-current 0.7s linear infinite;
}

.header-circuit-link:hover .header-switch-main .header-switch-blade,
.header-circuit-link:focus-visible .header-switch-main .header-switch-blade {
  transform: rotate(-12deg);
}

@keyframes wire-current {
  to {
    stroke-dashoffset: -10;
  }
}

.header-wire {
  stroke: #8aa8ba;
  stroke-width: 1.3;
}

.header-contact {
  fill: #fff;
  stroke: #5d8097;
  stroke-width: 1.3;
}

.header-switch-blade {
  stroke: #3d6983;
  stroke-width: 2;
  stroke-linecap: round;
  transform-origin: 33px 22px;
  transform: rotate(32deg);
  transition:
    transform 0.25s,
    stroke 0.25s;
}

.header-led {
  fill: #b6c9d2;
  transition:
    fill 0.25s,
    filter 0.25s;
}

.is-energized .header-wire-out,
.is-current > .header-switch .header-wire-out,
.header-branch[open] > summary .header-wire-out {
  stroke: #8eac36;
  stroke-dasharray: 3 2;
  animation: wire-current 0.7s linear infinite;
}

.header-circuit-link:hover .header-led,
.header-circuit-link:focus-visible .header-led,
.header-sector-link:hover .header-led,
.header-sector-link:focus-visible .header-led {
  fill: #9fb94e;
  animation: led-current 1.5s ease-in-out infinite;
}

@keyframes led-current {
  0%,
  100% {
    filter: drop-shadow(0 0 1px #94b93840);
  }
  50% {
    filter: drop-shadow(0 0 5px #94b938aa);
  }
}

.is-energized .header-switch-blade,
.header-circuit-link.is-current .header-switch-blade,
.header-sector-link.is-current .header-switch-blade,
.header-branch.is-current > summary .header-switch-blade,
.header-branch[open] > summary .header-switch-blade {
  transform: rotate(0deg) !important;
  stroke: #72962e;
}

.is-energized .header-led,
.header-circuit-link.is-current .header-led,
.header-sector-link.is-current .header-led,
.header-branch.is-current > summary .header-led,
.header-branch[open] > summary .header-led {
  fill: #9cbc3d;
  filter: drop-shadow(0 0 3px #9cbc3d55);
}

.is-energized.header-circuit-link,
.is-current.header-circuit-link,
.header-branch.is-current > summary,
.header-branch[open] > summary {
  background: #f2f7e9;
  border-color: #dce8c4;
}

.sector-chevron {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 16px;
  color: #758e9c;
  transition: transform 0.2s;
}

.header-branch[open] .sector-chevron {
  transform: rotate(180deg);
}

.header-branch-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding-bottom: 24px;
  z-index: 10;
  isolation: isolate;
}
.header-branch-panel::before {
  content: '';
  position: absolute;
  inset: 0 -24px -28px;
  background: linear-gradient(#fffffffa 75%, #ffffff00);
  z-index: -1;
  pointer-events: none;
}
.header-branch-wires {
  position: absolute;
  top: 0;
  width: 100%;
  height: 110px;
  overflow: visible;
  pointer-events: none;
}

.branch-on {
  position: absolute;
  top: 40px;
  left: calc(50% + 24px);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #678d27;
  opacity: 0;
  transition: opacity 0.3s;
}

.header-branch[open] > summary .branch-on {
  opacity: 1;
}

.branch-root-junction,
.branch-junction {
  fill: #fff;
  stroke: #7b9b3c;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.branch-junction-ring {
  fill: #bbd96d;
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: junction-pulse 2.4s ease-out infinite;
  animation-delay: var(--node-delay);
}

.branch-charge {
  fill: #bbdb66;
  filter: drop-shadow(0 0 4px #a3cc49);
}

@keyframes junction-pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.4);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.branch-terminal {
  width: 18px;
  height: 4px;
  border-top: 1px solid #9bb5c4;
  border-bottom: 1px solid #9bb5c4;
  margin-top: auto;
  transition:
    width 0.25s,
    border-color 0.25s;
}

.header-branch-link:hover .branch-terminal,
.header-branch-link:focus-visible .branch-terminal,
.header-branch-link.is-energized .branch-terminal {
  width: 30px;
  border-color: #8caf36;
}

@media (prefers-reduced-motion: reduce) {
  .branch-charge {
    display: none;
  }
}
.header-branch-wires path {
  fill: none;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.branch-path-base {
  stroke: #c3d7e1;
  stroke-width: 1.5;
}
.branch-path-grow {
  stroke: #83a936;
  stroke-width: 2;
  stroke-dasharray: 100;
  animation: branch-extension 0.65s ease-out both;
}
.branch-path-current {
  stroke: #c2e365;
  stroke-width: 3;
  stroke-dasharray: 5 55;
  animation: branch-current 1.8s linear infinite;
}
@keyframes branch-extension {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes branch-current {
  to {
    stroke-dashoffset: -120;
  }
}
.header-branch-grid {
  display: grid;
  grid-template-columns: repeat(var(--branch-count), minmax(0, 1fr));
  padding-top: 98px;
}
.header-branch-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 9px;
  width: calc(100% - 12px);
  max-width: 165px;
  padding: 0 7px 14px;
  border: 1px solid #dce7ec;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  box-shadow: 0 10px 20px #193e5609;
  color: #24445b;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  transition:
    background 0.25s,
    border-color 0.25s;
  animation: branch-arrival 0.4s ease-out both;
  animation-delay: calc(0.35s + var(--branch-delay));
}
.header-branch-link:hover,
.header-branch-link:focus-visible {
  background: #f4f9e9;
  border-color: #b5ce81;
}
.header-branch-link:hover .header-switch-blade,
.header-branch-link:focus-visible .header-switch-blade {
  transform: rotate(-12deg);
}
.header-branch-link.is-energized,
.header-branch-link.is-current {
  background: #eff7e2;
  border-color: #b8ce8b;
}
@keyframes branch-arrival {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.circuit-detail {
  padding-top: 55px;
  padding-bottom: 90px;
}

.circuit-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #647c8b;
  margin-bottom: 45px;
}

.circuit-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #edf5e4;
  border: 1px solid #d9e7c9;
  color: #446e2e;
  padding: 7px 12px;
  border-radius: 30px;
  font-size: 10px;
  margin-left: auto;
}

.circuit-state::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5e8e3b;
}

.circuit-detail h1 {
  font-size: clamp(46px, 6vw, 86px);
  margin-bottom: 30px;
  max-width: 1050px;
}

.detail-intro {
  max-width: 760px;
  font-size: 21px;
  color: #61788a;
  margin-bottom: 45px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: 55px;
}

.detail-layout > img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 14px;
}

.detail-points {
  list-style: none;
  padding: 0;
  margin: 25px 0;
}

.detail-points li {
  padding: 14px 0;
  border-bottom: 1px solid #dbe5ea;
}

.circuit-detail .form-notice {
  padding: 28px;
  border: 1px solid #dbe5ea;
  border-radius: 14px;
  background: #f7fafc;
}

.detail-cta {
  margin-top: 60px;
  padding: 35px;
  background: #edf4f8;
  border: 1px solid #d9e7ec;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}

.detail-cta h2 {
  font-size: 28px;
  margin: 0;
}

@media (max-width: 1100px) {
  .header-circuit-menu {
    margin-left: 22px;
    gap: 0;
  }

  .header-circuit-link {
    font-size: 12px;
    gap: 6px;
    padding-inline: 6px;
  }

  .header-switch {
    width: 32px;
  }

  .header-switch-main {
    width: 40px;
  }
}

@media (max-width: 991px) {
  html {
    scroll-padding-top: 110px;
  }

  .circuit-header {
    min-height: 94px;
    padding-block: 18px;
  }

  .circuit-header .navbar-collapse {
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }

  .header-circuit-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0;
    padding: 8px 0 20px;
    min-height: 0;
  }

  .header-main-bus {
    display: none;
  }

  .header-circuit-link {
    flex-direction: row;
    justify-content: flex-start;
    font-size: 15px;
    padding: 12px;
    gap: 13px;
    min-height: 58px;
  }

  .header-switch {
    width: 40px;
  }

  .sector-chevron {
    position: static;
    margin-left: auto;
  }

  .header-branch-panel {
    position: static;
    padding: 0 0 10px;
  }
  .header-branch-panel::before,
  .header-branch-wires {
    display: none;
  }
  .header-branch-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-left: 32px;
    padding: 12px 0 0 18px;
    border-left: 2px solid #a4bd75;
  }
  .header-branch-link {
    flex-direction: row;
    justify-self: stretch;
    align-items: center;
    width: 100%;
    max-width: none;
    padding: 4px 12px;
    border: 1px solid #dce7ec;
    border-radius: 8px;
    text-align: left;
  }
  .header-branch-link::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 50%;
    width: 18px;
    border-top: 2px solid #a4bd75;
  }
  .header-branch-link .header-switch {
    width: 32px;
    height: 42px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: 90px;
  }

  .circuit-header {
    min-height: 78px;
    padding-block: 12px;
  }

  .detail-intro {
    font-size: 18px;
  }

  .detail-cta {
    padding: 25px;
    flex-direction: column;
    align-items: flex-start;
  }
}
html {
  scroll-padding-top: 155px;
}
.header-utility {
  position: absolute;
  top: 99px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #6f899a;
}
.header-utility a,
.header-utility button {
  color: #365e79;
  background: none;
  border: 0;
  padding: 3px 0;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.header-utility a:hover,
.header-utility button:hover {
  color: #76952e;
  text-decoration: underline;
}
.circuit-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.circuit-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.circuit-breadcrumb li + li::before {
  content: '/';
  color: #a0b5c2;
  font-weight: 400;
}
.circuit-breadcrumb li[aria-current] {
  font-weight: 600;
  color: #345b73;
}
.circuit-site .circuit-breadcrumb {
  padding: 14px 18px;
  background: #f4f8fb;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  font-size: 13px;
}
@media (max-width: 991px) {
  .header-utility {
    top: 60px;
    font-size: 11px;
    gap: 10px;
  }
}
@media (max-width: 600px) {
  .header-utility {
    top: 49px;
  }
  .circuit-header {
    padding-bottom: 20px;
  }
  .circuit-breadcrumb {
    padding: 12px;
    font-size: 12px;
    gap: 14px;
  }
  .circuit-state {
    margin-left: 0;
  }
}
.circuit-site .circuit-breadcrumb ol {
  gap: 12px;
}
.circuit-site .circuit-breadcrumb li {
  gap: 10px;
}
.circuit-site .circuit-breadcrumb li + li::before {
  display: none;
}
.circuit-site .circuit-breadcrumb .header-switch {
  width: 42px;
  height: 30px;
  margin: 0;
}
.breadcrumb-source {
  width: 8px;
  height: 8px;
  border: 1px solid #7f9d45;
  border-radius: 50%;
  background: #c0db75;
  box-shadow: 0 0 0 4px #b5cf6920;
}
.circuit-site .circuit-breadcrumb li[aria-current] .header-switch-blade,
.circuit-site .circuit-breadcrumb li:has(a:hover) .header-switch-blade,
.circuit-site .circuit-breadcrumb li:has(a:focus-visible) .header-switch-blade {
  transform: rotate(0);
  stroke: #7d9e36;
}
.circuit-site .circuit-breadcrumb li[aria-current] .header-led {
  fill: #a5c845;
}
.circuit-site .circuit-breadcrumb li[aria-current] .header-wire-out {
  stroke: #91b43d;
  stroke-dasharray: 3 3;
  animation: breadcrumb-current 1.1s linear infinite;
}
@keyframes breadcrumb-current {
  to {
    stroke-dashoffset: -12;
  }
}
