#dlg.has-speaker {
  color: #ffffff;
  background: #352347;
  border: 2px solid #fff;
  border-radius: 15px;
  box-shadow: 0 0 0 1px #281a3c, 0 3px 0 #281a3c;
  max-height: calc(100% - 8px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#dlg.has-speaker.above { top: 4px; bottom: auto }
#dlg.has-speaker .dialog-line {
  display: grid;
  grid-template-columns: clamp(52px, 15vw, 76px) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
#speakerArt {
  width: 100%; height: auto; image-rendering: pixelated;
  border-radius: 12px; box-sizing: border-box;
  border: 2px solid #ffaa65;
  background: linear-gradient(#f5e7ff 70%, #dfc4f2 70%);
}
#dlg.has-speaker .who { color: #ffd065; font-size: 14px }
#dlg.has-speaker .talk-hearts { color: #ffc5d8 !important; font-size: 12px !important; white-space: nowrap }
#dlg.has-speaker .txt { color: #fff; font-weight: 600; min-height: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere }
#dlg.has-speaker .cb { color: #ffffff; background: #52385e; border-color: #cab4dc }
#dlg.has-speaker .cb.pri { color: #352347; background: #ffd065; border-color: #f4b04e }
#mapSpeech {
  position: absolute; z-index: 1; pointer-events: none; white-space: nowrap;
  color: #302037; background: #fff; border: 2px solid #352347;
  border-radius: 10px; padding: 2px 7px; box-shadow: 0 0 0 1px #fff;
  font-family: inherit; font-weight: bold; font-size: 12px; line-height: 1.4;
}
#mapSpeech::after {
  content: ''; position: absolute; bottom: -5px; left: var(--tip,50%);
  width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg);
  background: #fff; border-right: 2px solid #352347; border-bottom: 2px solid #352347;
}
#mapSpeech.below::after { bottom: auto; top: -5px; transform: translateX(-50%) rotate(225deg) }
#dlg { z-index: 2 }
