.planet-simulation-section {
  position: relative;
  order: 5 !important;
  scroll-margin-top: 9rem;
  overflow: hidden;
  border-top: 1px solid rgba(244, 210, 122, 0.38);
  border-bottom: 1px solid rgba(244, 210, 122, 0.38);
  background:
    linear-gradient(180deg, rgba(8, 12, 16, 0.97), rgba(3, 6, 9, 0.99)),
    #05080b;
}

.planet-simulation-inner {
  width: min(calc(100% - 2rem), 1600px);
  margin: 0 auto;
}

main > .registration-live-notice { order: 6 !important; }
main > .access-login-ribbon { order: -100 !important; }
main > #biomatrix-technology { order: -99 !important; }
main > #investor-access,
main > #formation { order: 8 !important; }

.planet-simulation-head {
  align-items: end;
}

.planet-control-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.2fr) minmax(150px, 0.7fr) auto;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 0.7rem;
  padding: 0.7rem;
  border: 1px solid rgba(111, 222, 255, 0.38);
  background: linear-gradient(135deg, rgba(7, 17, 25, 0.94), rgba(4, 8, 13, 0.88));
  box-shadow: inset 0 0 0 1px rgba(244, 210, 122, 0.12), 0 0 22px rgba(47, 188, 231, 0.08);
}

.planet-control-bar .field,
.planet-control-bar .planet-run-buttons {
  min-width: 0;
}

.planet-location-status {
  display: block;
  min-height: 1.2em;
  margin-top: 0.3rem;
  color: rgba(207, 228, 238, 0.78);
  font-size: 0.72rem;
  line-height: 1.35;
}

.planet-control-bar select,
.planet-run-buttons .btn,
.planet-source-row .btn,
.planet-classification-toolbar button {
  position: relative;
  min-height: 38px;
  border: 1px solid rgba(111, 222, 255, 0.48);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 38%),
    linear-gradient(180deg, rgba(11, 25, 36, 0.96), rgba(2, 7, 12, 0.98));
  box-shadow: inset 0 0 0 1px rgba(244, 210, 122, 0.12), inset 0 -8px 18px rgba(0, 0, 0, 0.32), 0 0 12px rgba(60, 210, 255, 0.08);
}

.planet-run-buttons .btn,
.planet-source-row .btn,
.planet-classification-toolbar button,
.planet-country-status-list button {
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.planet-run-buttons .btn:hover,
.planet-source-row .btn:hover,
.planet-classification-toolbar button:hover,
.planet-classification-toolbar button.active {
  color: #fff4c7;
  border-color: #f3d46f;
  box-shadow: inset 0 0 16px rgba(95, 219, 255, 0.14), 0 0 16px rgba(244, 210, 122, 0.18);
  transform: translateY(-1px);
}

.planet-run-buttons .btn.primary {
  color: #071017;
  border-color: #f4d56c;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 36%),
    linear-gradient(180deg, #f4d76f, #b99124);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 210, 0.42), 0 0 16px rgba(244, 210, 122, 0.22);
}

.planet-run-buttons {
  flex-wrap: nowrap;
  align-items: end;
}

.planet-status-legend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.planet-status-legend span {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid currentColor;
  font-size: 8pt;
  line-height: 1.35;
}

.planet-legend-green-one { color: #80f2aa; background: rgba(22, 145, 74, 0.19); }
.planet-legend-green-two { color: #63d891; background: rgba(28, 119, 72, 0.18); }
.planet-legend-green-three { color: #9fcf75; background: rgba(101, 131, 38, 0.17); }
.planet-legend-yellow { color: #ffe28a; background: rgba(207, 160, 28, 0.15); }
.planet-legend-red { color: #ff8d8d; background: rgba(194, 47, 55, 0.17); }
.planet-legend-black { color: #d5d9e0; background: rgba(0, 0, 0, 0.7); }

.planet-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 0.55rem;
  width: 100%;
  margin-inline: auto;
  min-height: 0;
  background: transparent;
}

.planet-visual-grid:not(.has-country) {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
}

[hidden] { display: none !important; }

.planet-globe-stage,
.planet-country-stage,
.planet-telemetry-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(244, 210, 122, 0.38);
  background:
    radial-gradient(circle at center, rgba(16, 93, 116, 0.2), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(110, 224, 255, 0.035) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(244, 210, 122, 0.03) 39px 40px);
}

.planet-country-stage {
  cursor: grab;
}

.planet-country-stage:active { cursor: grabbing; }

#planetGlobeCanvas,
#planetCountryCanvas {
  display: block;
  width: min(100%, 500px);
  height: auto;
  max-width: 500px;
  aspect-ratio: 1;
  touch-action: none;
}

#planetCountryCanvas {
  transform: translate(var(--planet-country-pan-x, 0px), var(--planet-country-pan-y, 0px)) scale(var(--planet-country-zoom, 1));
  transform-origin: center;
  transition: transform 180ms ease;
}

.planet-country-stage.is-panning #planetCountryCanvas { transition: none; }

#planetGlobeCanvas {
  cursor: grab;
}

#planetGlobeCanvas:active {
  cursor: grabbing;
}

.planet-stage-label {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.4rem 0.55rem;
  color: #f8f4ea;
  border: 1px solid rgba(244, 210, 122, 0.35);
  background: rgba(1, 4, 7, 0.82);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.planet-stage-label b { color: #ffe49a; }
.planet-stage-label span { color: #aebac4; font-size: 8pt; text-align: right; }

.planet-telemetry-stage {
  display: block;
  padding: 0.7rem;
  place-items: initial;
  overflow: auto;
}

.planet-zoom-controls {
  display: grid;
  gap: 0.5rem;
}

.planet-zoom-controls label {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1fr) 3.4rem;
  gap: 0.45rem;
  align-items: center;
  color: #cbd8df;
  font-size: 8pt;
}

.planet-zoom-controls input,
.planet-zoom-controls select { width: 100%; min-width: 0; accent-color: #efd16c; }
.planet-zoom-controls select { grid-column: 2 / 4; }
.planet-zoom-controls output { color: #ffe49a; text-align: right; }

.planet-zoom-controls .planet-flood-toggle .planet-toggle-control {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #bfe9f7;
}

.planet-zoom-controls .planet-flood-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.planet-live-weather {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.planet-live-weather span {
  display: grid;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid rgba(111, 222, 255, 0.22);
  background: rgba(1, 5, 9, 0.72);
}

.planet-live-weather b { color: #f8dc83; font-size: 10pt; }
.planet-live-weather small { color: #91a4b0; font-size: 8pt; }

#planetAlbedoCanvas {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.7rem;
  border: 1px solid rgba(244, 210, 122, 0.22);
  background: #020609;
}

.planet-weather-note {
  margin: 0.55rem 0 0;
  color: #91a2ad;
  font-size: 8pt;
  line-height: 1.45;
}

.planet-time-control {
  padding: 0.7rem 0;
}

.planet-time-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.planet-time-control input {
  width: 100%;
  accent-color: #d8b64a;
}

.planet-time-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: #8fa1ae;
  font-size: 8pt;
}

.planet-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.planet-kpi-grid span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid rgba(244, 210, 122, 0.25);
  background: rgba(5, 9, 13, 0.82);
}

.planet-kpi-grid b {
  color: #f8df8e;
  font-size: 10pt;
  overflow-wrap: anywhere;
}

.planet-kpi-grid small {
  color: #98a8b3;
  font-size: 8pt;
}

.planet-timeline-stage {
  padding: 0.65rem;
  border: 1px solid rgba(244, 210, 122, 0.3);
  background: rgba(2, 5, 8, 0.88);
}

.planet-analysis-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.planet-transition-stage {
  min-width: 0;
  max-height: 330px;
  padding: 0.65rem;
  overflow: auto;
  border: 1px solid rgba(111, 222, 255, 0.34);
  background: rgba(2, 7, 11, 0.92);
}

.planet-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  color: #ffe293;
}

.planet-panel-title span { color: #91a8b8; font-size: 8pt; }

.planet-transition-stage table,
.planet-scenario-comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
}

.planet-transition-stage th,
.planet-transition-stage td,
.planet-scenario-comparison th,
.planet-scenario-comparison td {
  padding: 0.35rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(111, 222, 255, 0.16);
}

.planet-transition-stage th,
.planet-scenario-comparison th { color: #ffe49a; background: rgba(244, 210, 122, 0.05); }

.planet-transition-stage h4 {
  margin: 0.75rem 0 0.4rem;
  color: #ffe293;
  font-size: 10pt;
}

.planet-transition-stage tr.selected {
  background: linear-gradient(90deg, rgba(244, 210, 122, 0.14), rgba(87, 211, 255, 0.08));
  box-shadow: inset 3px 0 0 #f0cc63;
}

#planetTimelineCanvas {
  display: block;
  width: 100%;
  height: 240px;
}

#planetSimulationStatus {
  margin: 0.45rem 0 0;
  color: #aebbc5;
  font-size: 8pt;
}

.planet-information-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.planet-information-grid details {
  min-width: 0;
  border: 1px solid rgba(244, 210, 122, 0.3);
  background: rgba(5, 9, 13, 0.78);
}

.planet-information-grid summary {
  cursor: pointer;
  padding: 0.65rem;
  color: #ffe49a;
  font-size: 10pt;
  font-weight: 700;
}

.planet-information-grid details > div {
  padding: 0 0.7rem 0.7rem;
  color: #d9e0e5;
  font-size: 8pt;
  line-height: 1.55;
}

.planet-information-grid table {
  width: 100%;
  border-collapse: collapse;
}

.planet-information-grid th,
.planet-information-grid td {
  padding: 0.35rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(244, 210, 122, 0.18);
}

.planet-country-status-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 0.35rem;
  max-height: 240px;
  margin-top: 0.7rem;
  padding: 0.55rem;
  overflow: auto;
  border: 1px solid rgba(244, 210, 122, 0.3);
}

.planet-country-status-list button {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
  padding: 0.45rem;
  color: #e8edf0;
  text-align: left;
  border: 1px solid rgba(111, 222, 255, 0.18);
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(13, 27, 37, 0.92), rgba(3, 7, 11, 0.96));
  box-shadow: inset 0 0 0 1px rgba(244, 210, 122, 0.05);
  cursor: pointer;
}

.planet-country-status-list button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planet-country-status-list button > small {
  white-space: nowrap;
}

.planet-country-status-list button:hover,
.planet-country-status-list button.active {
  border-color: #f1cf68;
  background: rgba(244, 210, 122, 0.08);
}

.planet-country-status-list i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.planet-country-status-list small { color: #91a1ad; }
.planet-status-green-i i { color: #4bef88; background: #4bef88; }
.planet-status-green-ii i { color: #38c974; background: #38c974; }
.planet-status-green-iii i { color: #93bd55; background: #93bd55; }
.planet-status-yellow i { color: #f1c84a; background: #f1c84a; }
.planet-status-red i { color: #ed5960; background: #ed5960; }
.planet-status-black i { color: #77808a; background: #07080a; border: 1px solid #aeb6be; }
.planet-status-black { background: linear-gradient(145deg, rgba(2, 2, 3, 0.98), rgba(13, 14, 16, 0.96)) !important; }

.planet-zone-skull {
  color: #f2f3f4;
  font-size: 12pt;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
}

.planet-classification-toolbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.planet-classification-toolbar button {
  color: #dce9ef;
  cursor: pointer;
  white-space: nowrap;
}

.planet-filter-green-i { border-color: rgba(75, 239, 136, 0.52) !important; }
.planet-filter-green-ii { border-color: rgba(56, 201, 116, 0.48) !important; }
.planet-filter-green-iii { border-color: rgba(147, 189, 85, 0.48) !important; }
.planet-filter-yellow { border-color: rgba(231, 189, 63, 0.52) !important; }
.planet-filter-red { border-color: rgba(219, 77, 86, 0.55) !important; }
.planet-filter-black { border-color: rgba(210, 218, 225, 0.45) !important; background: #050608 !important; }

.planet-classification-toolbar b { color: #ffe49a; }

.planet-black-disclaimer {
  margin: 0.45rem 0 0;
  color: #84929c;
  font-size: 8pt;
}

.planet-source-row {
  margin-top: 0.7rem;
}

@media (max-width: 1120px) {
  .planet-control-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planet-run-buttons {
    grid-column: 1 / -1;
  }

  .planet-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .planet-telemetry-stage { grid-column: 1 / -1; min-height: 0; }

  .planet-globe-stage,
  .planet-country-stage {
    min-height: 50vw;
  }

  .planet-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planet-country-status-list {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }

  .planet-information-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planet-status-legend,
  .planet-classification-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .planet-simulation-inner {
    width: calc(100% - 1rem);
  }

  .planet-control-bar,
  .planet-status-legend,
  .planet-visual-grid,
  .planet-information-grid,
  .planet-analysis-split {
    grid-template-columns: 1fr;
  }

  .planet-globe-stage,
  .planet-country-stage,
  .planet-telemetry-stage {
    min-height: calc(100vw - 1rem);
  }

  .planet-country-stage {
    border-top: 1px solid rgba(244, 210, 122, 0.34);
    border-left: 0;
  }

  .planet-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planet-country-status-list {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .planet-classification-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planet-stage-label {
    flex-direction: column;
  }

  .planet-stage-label span {
    text-align: left;
  }
}
