.science-empty {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px dashed #34463f;
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.science-empty strong {
  color: var(--gold);
  font-size: 11px;
}

.science-group {
  border-top: 1px solid rgba(84, 114, 100, .28);
}

.science-group:first-child {
  border-top: 0;
}

.science-group-header {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
}

.science-group-expand {
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.science-group-expand span {
  display: inline-block;
  font-size: 18px;
  transform: rotate(0deg);
  transition: transform .15s ease;
}

.science-group-expand[aria-expanded="true"] span {
  transform: rotate(90deg);
}

.science-group-check {
  font-weight: 700;
}

.science-group-children {
  padding: 0 0 6px 22px;
}

.science-group-children.hidden {
  display: none;
}

.science-layer-row {
  color: #aebdb7;
}

.science-domain-geology { background: #c7a36c; }
.science-domain-elevation { background: #78b7b2; }
.science-domain-magnetics { background: #c86d8b; }
.science-domain-gravity { background: #8477c8; }

.map-legends {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 26px;
  width: min(320px, calc(100% - 28px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.map-legends .map-legend {
  position: static;
  width: 100%;
  max-width: none;
  padding: 9px 11px;
  pointer-events: auto;
}

.map-legends .map-legend.hidden {
  display: none;
}

.map-legends .map-legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.map-legend-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #17211e;
  color: var(--muted);
  line-height: 1;
  cursor: pointer;
}

.map-legend-toggle:hover {
  color: var(--text);
  border-color: #486057;
}

.map-legends .map-legend.collapsed .map-legend-items,
.map-legends .map-legend.collapsed .scientific-legend-items {
  display: none;
}

.map-legends .map-legend-items {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.map-legends .map-legend-item {
  display: flex;
}

.scientific-map-legend .scientific-legend-items {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow: auto;
  margin-top: 8px;
  padding-right: 3px;
}

.scientific-map-legend .science-legend-layer {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(84, 114, 100, .35);
  padding-top: 9px;
}

.scientific-map-legend .science-legend-layer:first-child {
  border-top: 0;
  padding-top: 0;
}

.scientific-map-legend .science-legend-layer > strong {
  color: #dce7e2;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.scientific-map-legend .science-legend-layer > small,
.scientific-map-legend .science-legend-note,
.scientific-map-legend .science-legend-error {
  display: block;
  color: #81938b;
  font-size: 9px;
  line-height: 1.4;
}

.scientific-map-legend .science-legend-error {
  color: #e39a89;
}

.scientific-map-legend .science-legend-image {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  object-position: left center;
  border-radius: 5px;
  background: #fff;
}

.scientific-map-legend .science-legend-gradient {
  display: block;
  width: 100%;
  height: 12px;
  border: 1px solid #91a09a55;
  border-radius: 99px;
}

.scientific-map-legend .science-gradient-labels {
  display: flex;
  justify-content: space-between;
  color: #9aaaa3;
  font-size: 9px;
}

.scientific-map-legend .science-legend-symbols {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}

.scientific-map-legend .science-legend-symbols > div {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  font-size: 9px;
  color: #aebdb7;
}

.scientific-map-legend .science-legend-symbols i {
  width: 12px;
  height: 12px;
  border: 1px solid;
  border-radius: 2px;
}

@media (max-width: 1050px) {
  .map-legends { width: min(280px, calc(100% - 28px)); }
}
