figure.osi-motion {
  min-width: 0;
  margin: .9rem 0 1.15rem;
  padding: clamp(.65rem, 2vw, 1rem);
  border: 1px solid #536d95;
  border-radius: .65rem;
  background: #101e33;
  color: #e9f3ff;
}

.osi-layer-detail figure.osi-motion { margin: .75rem; }

.osi-motion-title {
  margin-bottom: .7rem;
  font-weight: 700;
  color: #f0f7ff;
}

.osi-motion-map {
  position: relative;
  margin: .65rem 0 .8rem;
  padding: .65rem .15rem .2rem;
  border: 1px solid #365375;
  border-radius: .55rem;
  background: radial-gradient(ellipse at center bottom, #253e5a, #152740 78%);
}

.osi-motion-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .25rem;
}

.osi-motion-node {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: .2rem;
  min-height: 3.5rem;
  padding: .45rem .15rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  text-align: center;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.osi-motion-node[data-current] {
  border-color: #65bed4;
  background: #1c4059;
}

.osi-motion-node strong { font-size: .88rem; }
.osi-motion-node small { color: #c4d8ed; font-size: .8rem; }

.osi-motion-track {
  position: relative;
  display: grid;
  align-items: center;
  height: 3.8rem;
  margin: 0 16.667%;
}

.osi-motion-track::before {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  border-top: 2px dashed #7199be;
  content: '';
}

.osi-motion-arrows {
  display: flex;
  justify-content: space-around;
  align-items: center;
  color: #8ed9ed;
  font-weight: 750;
}

.osi-motion-arrows span {
  position: relative;
  padding: 0 .15rem;
  background: #233c59;
  line-height: 1;
}

.osi-motion[data-motion-direction="back"] .osi-motion-arrows span { transform: rotate(180deg); }

.osi-motion-token {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 50%;
  width: max-content;
  max-width: clamp(3.75rem, 16vw, 7rem);
  padding: .2rem .34rem;
  border: 1px solid #6ed2ea;
  border-radius: .32rem;
  background: #183e56;
  color: #e8fbff;
  font: 650 .76rem/1.2 ui-monospace, monospace;
  text-align: center;
  overflow-wrap: anywhere;
  transform: translate(-50%, -50%);
}

.osi-motion-token[data-tone="received"] {
  border-color: #9ae7c9;
  background: #1b463c;
  color: #e5fff5;
}

.osi-motion-token[data-tone="lost"] {
  border-color: #f2a291;
  background: #53323c;
  color: #fff0ec;
}

.osi-motion-reassembly {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .8rem;
  margin: 0 0 .8rem;
  color: #c4d8ed;
  font-size: .875rem;
}

.osi-motion-tiles {
  display: grid;
  flex: 0 0 6.5rem;
  aspect-ratio: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #6f96b6;
  border-radius: .45rem;
}

.osi-motion-tiles span {
  display: grid;
  place-items: center;
  border: 1px dashed #6688ac;
  background: repeating-linear-gradient(135deg, #172b45 0 5px, #213854 5px 10px);
  color: #dfedfb;
}

.osi-motion-tiles span[data-present] {
  border-color: transparent;
  background-image: url("assets/osi-cat.webp");
  background-size: 200% 200%;
  background-origin: border-box;
  background-clip: border-box;
}

.osi-motion-tiles span[data-present] b { display: none; }
.osi-motion-tiles span[data-motion-tile="2"] { background-position: 100% 0; }
.osi-motion-tiles span[data-motion-tile="3"] { background-position: 0 100%; }
.osi-motion-tiles span[data-motion-tile="4"] { background-position: 100% 100%; }

.osi-motion[data-osi-motion="1"] .osi-motion-token::before {
  display: block;
  width: 1.75rem;
  height: .45rem;
  margin: 0 auto .2rem;
  background: #9feafa;
  clip-path: polygon(0 80%, 10% 80%, 10% 5%, 25% 5%, 25% 80%, 40% 80%, 40% 5%, 75% 5%, 75% 80%, 100% 80%, 100% 100%, 65% 100%, 65% 28%, 50% 28%, 50% 100%, 15% 100%, 15% 28%, 12% 28%, 12% 100%, 0 100%);
  content: '';
}

.osi-motion-status > span { color: #acd0ea; font-size: .825rem; }
.osi-motion-status p { min-height: 2.5em; margin: .18rem 0 .7rem; }
.osi-motion-modes, .osi-motion-controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.osi-motion-controls button { align-self: flex-start; }
