.dh-figure {
  --dh-ink: #20211d;
  --dh-paper: #faf8ef;
  --dh-yellow: #ffdb4d;
  --dh-font: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color: var(--dh-ink);
  margin: 0;
}
.dh-figure__alice { --dh-color: #c6b6ed; --dh-tint: #f3eefa; }
.dh-figure__bob { --dh-color: #b4e5cf; --dh-tint: #edf7f0; }
.dh-figure__board {
  container-type: inline-size;
  padding: clamp(14px, 3.3%, 20px);
  background: radial-gradient(circle, #2728202b .8px, transparent .95px) 0 0 / 15px 15px, var(--dh-paper);
}
.dh-figure__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dh-figure__station, .dh-figure__arrival, .dh-figure__source {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1.65px solid var(--dh-ink);
  border-radius: 7px;
  box-shadow: 2px 2px var(--dh-ink);
  text-align: center;
  background: var(--dh-tint);
}
.dh-figure__station { overflow: hidden; }
.dh-figure__station h4, .dh-figure__arrival h4 {
  margin: 0;
  font: 700 .88rem/1.3 Inter, system-ui, sans-serif;
}
.dh-figure__station h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid var(--dh-ink);
  background: var(--dh-color);
  padding: 6px;
}
.dh-figure__station svg { display: inline-block; flex: none; width: 14px; height: 14px; }
.dh-figure__private, .dh-figure__send, .dh-figure__copy { font: 600 .8rem/1.3 var(--dh-font); }
.dh-figure__private { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 8px 4px 3px; }
.dh-figure__private span { display: inline-flex; gap: 3px; align-items: baseline; font: 600 .77rem/1.3 Inter, system-ui, sans-serif; }
.dh-figure__private strong { font-weight: inherit; }
.dh-figure__private svg { width: 11px; height: 11px; }
@container (max-width: 350px) {
  .dh-figure__private { display: grid; justify-items: center; gap: 1px; }
}
.dh-figure__send { padding: 3px 4px 8px; }
.dh-figure--private .dh-figure__private { font-weight: 750; }
.dh-figure--local .dh-figure__private { padding-block: 12px 5px; }
.dh-figure__local-formula { padding: 3px 4px 12px; font: 550 .9rem/1.5 var(--dh-font); }
.dh-figure__local-formula sup { font-size: .73em; }
.dh-figure--local .dh-figure__send { padding: 9px 5px; background: var(--dh-color); border-top: 1px solid var(--dh-ink); }
.dh-figure--exchange .dh-figure__send { background: var(--dh-color); border-top: 1px solid #20211d35; padding: 6px 3px; }
.dh-figure--exchange .dh-figure__private { padding-block: 6px; }
.dh-figure__params {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font: 600 .76rem/1.45 var(--dh-font);
}
.dh-figure__params span { color: #52544b; font-family: Inter, system-ui, sans-serif; }
.dh-figure__channel { position: relative; display: grid; gap: 5px; padding: 9px 0; }
.dh-figure__channel::before, .dh-figure__channel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1.5px dashed #73746b;
}
.dh-figure__channel::before { left: calc(25% - 4.5px); }
.dh-figure__channel::after { right: calc(25% - 4.5px); }
.dh-figure__route { position: relative; z-index: 1; height: 26px; }
.dh-figure__track {
  position: absolute;
  top: 50%;
  left: calc(25% - 4.5px);
  right: calc(25% - 4.5px);
  border-top: 2px solid var(--dh-ink);
}
.dh-figure__track::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 6px;
  height: 6px;
  border-block-start: 2px solid var(--dh-ink);
}
.dh-figure__alice .dh-figure__track::after { left: 50%; border-right: 2px solid var(--dh-ink); transform: rotate(45deg); }
.dh-figure__bob .dh-figure__track::after { right: 50%; border-left: 2px solid var(--dh-ink); transform: rotate(-45deg); }
.dh-figure__packet {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  max-width: 47%;
  padding: 4px 7px;
  white-space: nowrap;
  border: 1.5px solid var(--dh-ink);
  border-radius: 12px;
  background: var(--dh-color);
  box-shadow: 1.5px 1.5px var(--dh-ink);
  font: 700 clamp(.69rem, 1.2vw, .78rem)/1.2 var(--dh-font);
  text-transform: uppercase;
}
.dh-figure__alice .dh-figure__packet { left: calc(75% + 4.5px); }
.dh-figure__bob .dh-figure__packet { left: calc(25% - 4.5px); }
.dh-figure__route--empty .dh-figure__packet { background: var(--dh-paper); border-style: dashed; box-shadow: none; }
.dh-figure__alice.dh-figure__route--empty .dh-figure__packet { left: calc(25% - 4.5px); }
.dh-figure__bob.dh-figure__route--empty .dh-figure__packet { left: calc(75% + 4.5px); }
.dh-figure__destinations { position: relative; }
.dh-figure__arrival { display: grid; justify-items: center; align-content: center; gap: 3px; padding: 8px 4px; }
.dh-figure__arrival strong { font: 700 clamp(.96rem, 2vw, 1.27rem)/1.3 var(--dh-font); }
.dh-figure__calculation { font: 500 .76rem/1.35 var(--dh-font); color: #4a4b43; }
.dh-figure__calculation sup { font-size: .73em; }
.dh-figure--secret .dh-figure__arrival { background: var(--dh-color); }
.dh-figure__equal {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1.5px solid var(--dh-ink);
  border-radius: 50%;
  background: var(--dh-yellow);
  font: 700 1rem/1 var(--dh-font);
}
.dh-figure__caption { margin: 0; border-top: 1px solid #20211d22; padding: 14px 18px 16px; color: #45463f; font-size: .875rem; line-height: 1.5; }

.dh-figure__setup { padding: 9px 0 12px; }
.dh-figure__source { width: fit-content; max-width: 100%; margin: auto; padding: 11px 15px; background: var(--dh-yellow); }
.dh-figure__source > span { font: 650 .85rem Inter, system-ui, sans-serif; }
.dh-figure__source strong, .dh-figure__copy { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; }
.dh-figure__source strong { font: 700 1.12rem/1.4 var(--dh-font); gap: 4px 14px; margin-top: 3px; }
.dh-figure__copy { gap: 4px 12px; padding: 12px 5px; }
.dh-figure__broadcast { position: relative; height: 38px; }
.dh-figure__broadcast::before { content: ""; position: absolute; top: 0; left: 50%; height: 16px; border-left: 2px solid var(--dh-ink); }
.dh-figure__broadcast i { position: absolute; top: 15px; bottom: 0; width: calc(25% + 4.5px); border-top: 2px solid var(--dh-ink); }
.dh-figure__broadcast i:first-child { right: 50%; border-left: 2px solid var(--dh-ink); border-top-left-radius: 5px; }
.dh-figure__broadcast i:last-child { left: 50%; border-right: 2px solid var(--dh-ink); border-top-right-radius: 5px; }
.dh-figure__broadcast i::after { content: ""; position: absolute; bottom: 0; border: solid var(--dh-ink); border-width: 0 2px 2px 0; padding: 3px; transform: rotate(45deg); }
.dh-figure__broadcast i:first-child::after { left: -5px; }
.dh-figure__broadcast i:last-child::after { right: -5px; }

@media (prefers-reduced-motion: no-preference) {
  .dh-figure__derived { animation: dh-share-ready .55s ease-out both; }
  .dh-figure--local .dh-figure__derived { animation: dh-secret-ready .4s ease-out .25s both; }
  .dh-figure__alice.dh-figure__route:not(.dh-figure__route--empty) .dh-figure__packet { animation: dh-send-right 1.15s ease-in-out .45s both; }
  .dh-figure__bob.dh-figure__route:not(.dh-figure__route--empty) .dh-figure__packet { animation: dh-send-left 1.15s ease-in-out .8s both; }
  .dh-figure__bob.dh-figure__arrives { animation: dh-secret-ready .35s ease-out 1.63s both; }
  .dh-figure__alice.dh-figure__arrives { animation: dh-secret-ready .35s ease-out 1.98s both; }
  .dh-figure__equal { animation: dh-confirm .3s ease-out 2.3s both; }
  .dh-figure--setup .dh-figure__copy { animation: dh-secret-ready .55s ease-out .25s both; }
}
@keyframes dh-send-right { from { left: calc(25% - 4.5px); } to { left: calc(75% + 4.5px); } }
@keyframes dh-send-left { from { left: calc(75% + 4.5px); } to { left: calc(25% - 4.5px); } }
@keyframes dh-share-ready { from { opacity: .3; } to { opacity: 1; } }
@keyframes dh-secret-ready { from { opacity: .16; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dh-confirm { from { opacity: 0; } to { opacity: 1; } }
