html,
body.lightning-page {
  min-height: 100%;
}

body.lightning-page {
  margin: 0;
  overflow: hidden;
  background: #020403;
  color: #f4ffe8;
}

body.lightning-page header,
body.lightning-page footer {
  display: none;
}

body.lightning-page #nav-placeholder {
  position: relative;
  z-index: 900;
}

body.lightning-page main,
body.lightning-page section {
  max-width: none;
  margin: 0;
  padding: 0;
}

.lightning-shell {
  position: relative;
  width: 100vw;
  max-width: none;
  height: calc(100dvh - 94px);
  min-height: 560px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #020403;
}

.lightning-head {
  position: absolute;
  z-index: 650;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 380px) auto;
  gap: 12px;
  align-items: start;
  pointer-events: none;
}

.lightning-head > div {
  min-width: 0;
}

.lightning-head > div:first-child {
  width: min(380px, 100%);
  padding: 11px 13px 12px;
  border: 1px solid rgba(255, 208, 0, 0.28);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.82);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.lightning-kicker {
  color: #ffd000;
  font-size: 0.66rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightning-head h1 {
  margin: 4px 0 4px;
  color: #9cff00;
  font-size: clamp(1.3rem, 1.8vw, 1.9rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(156, 255, 0, 0.28);
}

.lightning-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.32;
}

.lightning-head small {
  display: block;
  margin-top: 7px;
  color: rgba(255, 208, 0, 0.76);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
}

.strike-request-open {
  position: relative;
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid rgba(255, 110, 98, 0.62);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(172, 18, 24, 0.96), rgba(84, 4, 8, 0.96));
  color: #fff5e8;
  font-size: 0.82rem;
  font-weight: 1000;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.06), 0 0 20px rgba(255, 48, 32, 0.2);
}

.strike-request-open:hover,
.strike-request-open:focus-visible {
  border-color: rgba(255, 220, 120, 0.92);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.09), 0 0 28px rgba(255, 62, 42, 0.38);
}

.strike-request-tip {
  position: absolute;
  left: 13px;
  top: calc(100% - 4px);
  z-index: 760;
  width: min(360px, calc(100vw - 40px));
  padding: 10px 11px;
  border: 1px solid rgba(255, 208, 0, 0.26);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.94);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.36;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.strike-request-open:hover + .strike-request-tip,
.strike-request-open:focus-visible + .strike-request-tip {
  opacity: 1;
  transform: translateY(0);
}

.lightning-window {
  justify-self: end;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(420px, 48vw);
  pointer-events: auto;
}

.lightning-window button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 208, 0, 0.38);
  border-radius: 7px;
  background: rgba(4, 10, 8, 0.86);
  color: #ffd000;
  font-size: 0.86rem;
  font-weight: 1000;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.lightning-window button[aria-pressed="true"] {
  background: #ffd000;
  color: #0b160a;
  box-shadow: 0 0 18px rgba(255, 208, 0, 0.28);
}

.lightning-layers {
  position: absolute;
  z-index: 650;
  top: 84px;
  right: 16px;
  display: grid;
  grid-template-columns: auto auto minmax(130px, 190px);
  gap: 8px;
  align-items: center;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid rgba(255, 208, 0, 0.26);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.84);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
}

.lightning-layers label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.lightning-layers input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ffd000;
}

.weather-monkey {
  position: absolute;
  z-index: 650;
  left: 16px;
  bottom: 52px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.weather-monkey img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(31vh, 250px);
  object-fit: contain;
  border: 1px solid rgba(255, 208, 0, 0.24);
  border-radius: 8px;
  background: rgba(3, 8, 7, 0.72);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
}

.weather-monkey div {
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(156, 255, 0, 0.22);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.82);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.weather-monkey span {
  display: block;
  color: #ffd000;
  font-size: 0.62rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.weather-monkey p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.22;
}

.lightning-opacity {
  min-width: 130px;
}

.lightning-opacity span {
  color: rgba(255, 255, 255, 0.68);
}

.lightning-opacity input {
  width: 100%;
  accent-color: #ffd000;
}

.lightning-legends {
  position: absolute;
  z-index: 650;
  top: 136px;
  right: 16px;
  width: min(330px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  pointer-events: auto;
}

.lightning-legend-block {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 208, 0, 0.22);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.8);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.lightning-legend-block h2 {
  margin: 0 0 7px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.64rem;
  font-weight: 1000;
  line-height: 1.15;
  text-transform: uppercase;
}

.cloud-legend,
.age-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cloud-legend li,
.age-legend li {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
}

.swatch,
.dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 9px rgba(0, 0, 0, 0.36);
}

.swatch {
  border-radius: 3px;
}

.dot {
  border-radius: 50%;
}

.cloud-red { background: #d5467c; }
.cloud-yellow { background: #d6c84b; }
.cloud-cyan { background: #55d4e8; }
.cloud-white { background: #f4f5e8; }
.cloud-green { background: #70b44f; }
.cloud-dark { background: #17201b; }

.age-new {
  background: #fffbe6;
  box-shadow: 0 0 13px rgba(255, 251, 230, 0.82), 0 0 20px rgba(255, 208, 0, 0.45);
}

.age-warm {
  background: #fff16a;
  box-shadow: 0 0 11px rgba(255, 241, 106, 0.62);
}

.age-aging {
  background: #ffc43d;
  box-shadow: 0 0 10px rgba(255, 196, 61, 0.45);
}

.age-old {
  background: #b99f3d;
  opacity: 0.72;
}

.lightning-legend-block details {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.67rem;
  font-weight: 750;
}

.lightning-legend-block summary {
  color: #ffd000;
  cursor: pointer;
}

.lightning-legend-block p {
  margin: 6px 0 0;
  line-height: 1.35;
}

.lightning-map-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #020403;
}

#lightningMap {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(20, 64, 92, 0.34), transparent 42%),
    #010407;
}

#lightningMap .maplibregl-canvas,
#lightningMap .maplibregl-canvas-container,
#lightningMap .maplibregl-map {
  width: 100% !important;
  height: 100% !important;
}

.lightning-map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  box-shadow:
    inset 0 90px 90px rgba(0, 0, 0, 0.42),
    inset 0 -90px 90px rgba(0, 0, 0, 0.46);
}

.lightning-stats {
  position: absolute;
  z-index: 650;
  left: auto;
  right: 16px;
  bottom: 52px;
  width: min(560px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  pointer-events: none;
}

.lightning-stats div {
  min-width: 0;
  border: 1px solid rgba(255, 208, 0, 0.24);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(3, 8, 7, 0.82);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(10px);
}

.lightning-stats span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lightning-stats b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #ffd000;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightning-stats b.is-live {
  color: #faffd9;
  text-shadow: 0 0 12px rgba(255, 208, 0, 0.62);
}

.lightning-stats b.is-delayed {
  color: #ffd000;
}

.lightning-stats b.is-stale {
  color: #ff8f2a;
}

.lightning-stats b.is-error {
  color: #ff6258;
}

.lightning-state {
  position: absolute;
  z-index: 700;
  left: 50%;
  top: 50%;
  max-width: min(520px, calc(100% - 32px));
  padding: 18px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 208, 0, 0.34);
  border-radius: 8px;
  background: rgba(2, 6, 4, 0.88);
  color: #ffd000;
  font-weight: 1000;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.lightning-state.is-hidden {
  display: none;
}

.lightning-info {
  position: absolute;
  z-index: 650;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.lightning-info p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightning-info button {
  position: absolute;
  right: 0;
  top: 50%;
  flex: 0 0 auto;
  min-height: 28px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 208, 0, 0.28);
  border-radius: 7px;
  background: rgba(4, 10, 8, 0.82);
  color: #ffd000;
  font-size: 0.72rem;
  font-weight: 950;
  cursor: pointer;
  pointer-events: auto;
}

.lightning-info button:hover {
  background: rgba(255, 208, 0, 0.14);
}

.product-details-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  margin: 0;
  padding: 16px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 208, 0, 0.34);
  border-radius: 8px;
  background: #06100c;
  color: #efffe3;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.58);
}

.strike-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 42px));
  margin: 0;
  overflow: auto;
  padding: 16px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 64, 52, 0.48);
  border-radius: 8px;
  background: #070b08;
  color: #efffe3;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.64), 0 0 36px rgba(255, 28, 20, 0.16);
}

.strike-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.strike-dialog img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #020403;
}

.strike-dialog h2 {
  margin: 13px 42px 2px 0;
  color: #9cff00;
  font-size: 1.35rem;
  line-height: 1.1;
}

.strike-tagline {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  font-style: italic;
  font-weight: 850;
}

.strike-step {
  margin-top: 12px;
}

.strike-step-label {
  margin-bottom: 8px;
  color: rgba(255, 208, 0, 0.74);
  font-size: 0.68rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.strike-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.strike-mode label,
.strike-fields label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  font-weight: 950;
}

.strike-mode label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 208, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.strike-mode input {
  accent-color: #ffd000;
}

.strike-fields {
  display: grid;
  gap: 6px;
}

.strike-latlon {
  grid-template-columns: 1fr 1fr;
}

.strike-fields input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 208, 0, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 850;
}

.strike-validation {
  min-height: 20px;
  margin: 8px 0;
  color: #ff766c;
  font-size: 0.76rem;
  font-weight: 900;
}

.strike-request-button,
.energy-contract-button,
.strike-close-button {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 1000;
  cursor: pointer;
}

.strike-request-button {
  border: 1px solid rgba(255, 110, 98, 0.7);
  background: linear-gradient(180deg, #df2424, #74080c);
  color: #fff5e8;
  box-shadow: 0 0 24px rgba(255, 44, 30, 0.22);
}

.energy-contract-button {
  margin-top: 10px;
  border: 1px solid rgba(156, 255, 0, 0.44);
  background: #9cff00;
  color: #102008;
}

.strike-close-button {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

.strike-response {
  min-height: 0;
  margin-top: 12px;
  padding: 0;
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.36;
}

.strike-response:not(:empty) {
  padding: 12px;
  border: 1px solid rgba(255, 208, 0, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.strike-step-result .strike-response:not(:empty) {
  border-color: rgba(156, 255, 0, 0.24);
  background: rgba(3, 14, 9, 0.5);
}

.product-details-dialog::backdrop {
  background: rgba(0, 0, 0, 0.52);
}

.product-details-dialog h2 {
  margin: 0 42px 10px 0;
  color: #9cff00;
  font-size: 1rem;
  line-height: 1.2;
}

.product-details-dialog pre {
  max-height: min(560px, calc(100dvh - 190px));
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.product-details-dialog > button {
  margin-top: 12px;
  min-height: 32px;
  border: 1px solid rgba(255, 208, 0, 0.34);
  border-radius: 7px;
  background: #ffd000;
  color: #0b160a;
  font-weight: 1000;
  cursor: pointer;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.lightning-footprint {
  stroke: rgba(255, 208, 0, 0.8);
  stroke-width: 1.2;
  fill: rgba(255, 208, 0, 0.035);
  stroke-dasharray: 7 9;
}

.maplibregl-popup-content {
  border: 1px solid rgba(156, 255, 0, 0.28);
  border-radius: 8px;
  background: #07100b;
  color: #efffe3;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

.maplibregl-popup-content strong {
  color: #ffd000;
}

.maplibregl-popup-tip {
  border-top-color: #07100b;
  border-bottom-color: #07100b;
}

.maplibregl-ctrl-group {
  border: 1px solid rgba(255, 208, 0, 0.24) !important;
  background: rgba(4, 11, 8, 0.88) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32) !important;
}

.maplibregl-ctrl-group button {
  background-color: transparent !important;
}

.maplibregl-ctrl-group button span {
  filter: invert(1) sepia(1) saturate(4) hue-rotate(355deg);
}

.maplibregl-ctrl button:not(:disabled):hover {
  background-color: rgba(255, 208, 0, 0.16) !important;
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib a {
  color: rgba(255, 255, 255, 0.62) !important;
}

.maplibregl-ctrl-attrib {
  border-color: rgba(255, 208, 0, 0.24);
  background: rgba(3, 8, 7, 0.62) !important;
}

@media (max-width: 900px) {
  body.lightning-page {
    overflow: auto;
  }

  .lightning-shell {
    display: grid;
    gap: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 10px;
    overflow: visible;
  }

  .lightning-head {
    position: static;
    grid-template-columns: 1fr;
    pointer-events: auto;
  }

  .lightning-head > div:first-child {
    width: auto;
  }

  .lightning-window {
    justify-self: stretch;
    max-width: none;
    justify-content: stretch;
  }

  .lightning-window button {
    flex: 1 1 82px;
  }

  .lightning-map-panel {
    position: relative;
    inset: auto;
    display: grid;
    gap: 10px;
    overflow: visible;
    background: transparent;
  }

  .lightning-map-panel::after {
    display: none;
  }

  #lightningMap {
    position: relative;
    inset: auto;
    order: 1;
    height: min(58dvh, 480px);
    min-height: 340px;
    overflow: hidden;
    border: 1px solid rgba(255, 208, 0, 0.22);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
  }

  .lightning-stats {
    position: static;
    order: 4;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightning-layers {
    position: static;
    order: 2;
    grid-template-columns: auto auto minmax(120px, 1fr);
  }

  .lightning-legends {
    position: static;
    order: 3;
    width: auto;
    grid-template-columns: 1fr 1fr;
  }

  .weather-monkey {
    position: static;
    order: 5;
    width: auto;
  }

  .weather-monkey img {
    max-height: 150px;
    object-position: left center;
  }

  .lightning-info {
    position: static;
    order: 6;
    min-height: 30px;
  }

  .lightning-info button {
    position: static;
    transform: none;
  }

  .lightning-state {
    top: 170px;
  }
}

@media (max-width: 560px) {
  .lightning-shell {
    height: auto;
    min-height: 0;
  }

  .lightning-head,
  .lightning-layers,
  .lightning-stats,
  .lightning-info {
    left: 10px;
    right: 10px;
  }

  .lightning-head {
    top: auto;
  }

  .lightning-head > div:first-child {
    padding: 12px;
  }

  .lightning-head p {
    display: none;
  }

  .lightning-head small {
    display: none;
  }

  .lightning-window {
    gap: 6px;
  }

  .lightning-window button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .lightning-layers {
    grid-template-columns: 1fr 1fr;
  }

  .lightning-opacity {
    grid-column: 1 / -1;
  }

  .lightning-legends {
    grid-template-columns: 1fr;
  }

  .cloud-legend,
  .age-legend {
    grid-template-columns: 1fr 1fr;
  }

  .lightning-stats {
    grid-template-columns: 1fr 1fr;
  }

  .weather-monkey {
    width: min(230px, calc(100vw - 20px));
  }

  .weather-monkey img {
    display: none;
  }

  .strike-dialog {
    padding: 12px;
  }

  .strike-dialog img {
    max-height: 170px;
  }

  .strike-mode,
  .strike-latlon {
    grid-template-columns: 1fr;
  }

  .lightning-info {
    display: grid;
    gap: 8px;
    justify-items: center;
  }

  .lightning-info button {
    position: static;
    transform: none;
  }
}
