html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Courier New", monospace;
  background: #02080d;
  color: #a6ffd2;
}

#map {
  width: 100%;
  height: 100%;
  background: black;
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 20% 10%, rgba(0, 187, 120, 0.18), transparent 55%), rgba(2, 8, 14, 0.9);
  backdrop-filter: blur(1px);
}

.boot-overlay.visible {
  display: flex;
}

.boot-window {
  width: min(760px, 100%);
  border: 1px solid #29504a;
  border-radius: 10px;
  overflow: hidden;
  background: #041118;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.boot-body {
  padding: 14px;
}

.boot-title {
  margin-bottom: 10px;
  color: #e8fff4;
  font: 700 18px/1.2 "Courier New", monospace;
}

.boot-status {
  margin-bottom: 10px;
  color: #aefdd5;
}

.boot-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #29504a;
  background: #08161c;
  overflow: hidden;
}

.boot-bar {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #19a84a, #69ffad);
  transition: width 180ms linear;
}

.boot-log {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #244941;
  border-radius: 8px;
  background: #021018;
  padding: 10px;
  color: #8de6bc;
  font-size: 0.9rem;
  line-height: 1.4;
}

.floating-button {
  position: fixed;
  z-index: 1202;
  left: 10px;
  top: 10px;
  font: 12px/1.2 "Courier New", monospace;
  padding: 7px 9px;
  border: 1px solid #2b5e53;
  border-radius: 6px;
  background: rgba(9, 24, 28, 0.94);
  color: #aefdd5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.floating-button--secondary {
  left: 118px;
}

.legend {
  position: fixed;
  z-index: 1200;
  left: 10px;
  top: 46px;
  width: min(400px, calc(100vw - 20px));
  background: rgba(7, 20, 27, 0.94);
  border: 1px solid #2b5e53;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.legend.hidden {
  display: none;
}

.terminal-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #13342f, #102924);
  border-bottom: 1px solid #21443e;
  color: #d7ffeb;
}

.terminal-title {
  font: 700 12px/1.2 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.terminal-dots {
  display: inline-flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.terminal-dot.red { background: #ff645d; }
.terminal-dot.yellow { background: #ffc83d; }
.terminal-dot.green { background: #2cd17c; }

.legend-body {
  padding: 14px;
}

.legend-body h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: #e8fff4;
}

.muted {
  color: #8de6bc;
}

.small {
  font-size: 0.84rem;
}

.field {
  display: block;
  margin-top: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  color: #8de6bc;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #2b5e53;
  border-radius: 8px;
  background: #0d2223;
  color: #d7ffeb;
  font: inherit;
  box-sizing: border-box;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mini-stats div {
  padding: 10px;
  border: 1px solid #244941;
  border-radius: 8px;
  background: #021018;
}

.mini-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: #8de6bc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-key {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.dot-site {
  background: #1fcf7a;
}

.dot-selected {
  background: #ff7b00;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  background: radial-gradient(circle at 20% 10%, rgba(0, 187, 120, 0.18), transparent 55%), rgba(2, 8, 14, 0.88);
  backdrop-filter: blur(1px);
  padding: 14px;
}

.detail-overlay.visible {
  display: block;
}

.detail-shell {
  width: 100%;
  height: 100%;
  border: 1px solid #29504a;
  border-radius: 10px;
  overflow: hidden;
  background: #041118;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #08332f 0%, #062621 100%);
  border-bottom: 1px solid #29504a;
  color: #a8ffd4;
}

.detail-kicker {
  font: 700 12px/1.2 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-title {
  margin-top: 6px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8fff4;
}

.detail-close {
  font: 700 11px/1.2 "Courier New", monospace;
  padding: 6px 10px;
  border: 1px solid #2b5e53;
  border-radius: 6px;
  background: #0d2223;
  color: #aefdd5;
  cursor: pointer;
}

.detail-body {
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: linear-gradient(180deg, #041118 0%, #020c12 100%);
}

.detail-card {
  border: 1px solid #244941;
  border-radius: 8px;
  padding: 12px;
  background: #021018;
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.detail-card h2,
.subsection h3 {
  margin: 0 0 10px;
  color: #e8fff4;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: #8de6bc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-item strong {
  display: block;
  font-size: 0.95rem;
  color: #d7ffeb;
  word-break: break-word;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: #0d2223;
  border: 1px solid #2b5e53;
  color: #aefdd5;
  font-size: 0.88rem;
}

.empty-note {
  color: #8de6bc;
  opacity: 0.88;
}

.detail-accordion {
  border: 1px solid #244941;
  border-radius: 8px;
  margin-top: 10px;
  overflow: hidden;
  background: #041118;
}

.detail-accordion summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #0b1d25;
  color: #d7ffeb;
}

.detail-accordion-body {
  padding: 12px;
}

.subsection {
  margin-top: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #244941;
  border-radius: 8px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1500px;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid #173038;
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.83rem;
}

.detail-table th {
  position: sticky;
  top: 0;
  background: #0d2223;
  color: #e8fff4;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(31, 207, 122, 0.18);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: rgba(31, 207, 122, 0.82);
  color: #041018;
  font-weight: 700;
}

@media (max-width: 920px) {
  .floating-button--secondary {
    left: 130px;
  }

  .detail-body,
  .detail-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .legend {
    top: 46px;
  }
}
