.hi-dlg.character-dialog, .base-dialog-overlay.character-dialog {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-height: none; padding: 0; margin: 0;
  display: block; transform: none; background: none; border: 0; border-radius: 0; box-shadow: none;
  overflow: visible; z-index: 3000; pointer-events: none; outline: none;
}
.character-dialog .base-dialog-card { display: contents; }
.character-dialog .dialog-speech, .character-dialog .dialog-replies { position: fixed; margin: 0; pointer-events: auto; visibility: hidden; }
.character-dialog.dialog-positioned .dialog-speech, .character-dialog.dialog-positioned .dialog-replies { visibility: visible; }
.character-dialog .dialog-speech { width: max-content; min-width: min(210px, var(--dialog-speech-width, 320px)); max-width: var(--dialog-speech-width, 320px); }
.character-dialog .dialog-speech-bubble { padding: 10px 12px; }
.character-dialog .dialog-speech-bubble:not([data-emotion="excited"])::after { left: var(--speech-tail-x, 50%); transform: translateX(-50%); }
.character-dialog .dialog-speech-bubble[data-tail="hidden"]:not([data-emotion="excited"])::after { display: none; }
.character-dialog .dialog-speech-head { display: flex; gap: 8px; align-items: center; margin: 0 0 5px; font-size: 0.85rem; line-height: 1.3; }
.character-dialog .dialog-speech-head strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.character-dialog .npc-voice-toggle { width: 28px; height: 28px; border: 0; background: none; border-radius: 4px; }
.character-dialog .dialog-speech-body { padding: 0; max-height: max(22px, min(calc(var(--dialog-speech-budget, 220px) - 57px), calc(var(--dialog-live-speech-budget, 220px) - 57px))); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.character-dialog .dialog-text-stack { display: grid; }
.character-dialog :is(.hi-dlg-text, .base-dialog-text, .dialog-text-measure) {
  grid-area: 1 / 1; padding: 0; margin: 0; min-height: 0; font-size: 0.95rem; line-height: 1.4;
  font-weight: 600; overflow-wrap: anywhere; white-space: normal;
}
.character-dialog .dialog-text-measure { visibility: hidden; pointer-events: none; user-select: none; }
.character-dialog .hi-dlg-card { border: 0; border-top: 1px solid #c5d4ca; border-radius: 0; padding: 7px 0 0; margin: 8px 0 0; background: none; font-size: 0.78rem; }
.character-dialog .dialog-replies { width: var(--dialog-reply-width, 240px); max-height: var(--dialog-reply-budget, 300px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
.character-dialog :is(.hi-dlg-ch, .base-dialog-row) { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; }
.character-dialog :is(.hi-dlg-btn, .base-dialog-row button) {
  flex: none; width: 100%; min-height: 42px; margin: 0; padding: 9px 11px; border: 2px solid #203329;
  border-radius: 6px; background: #fff; color: #18251f; box-shadow: none; text-align: left;
  font: inherit; font-size: 0.85rem; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; white-space: normal;
}
.character-dialog :is(.hi-dlg-btn, .base-dialog-row button):is(:hover, :focus-visible) { background: #d8eee1; }
.character-dialog :is(.hi-dlg-btn, .base-dialog-row button):focus-visible { outline: 3px solid #298258; outline-offset: -1px; }
.character-dialog .base-dialog-dots { display: none; }
body.base-dialog-open :is(#baseResBar, #baseBuildBtn, .ihint, .hi-title, .hi-exit, .hi-editbtn, .achievement-toast, .base-job-badge, .base-tile-label) { visibility: hidden; pointer-events: none; }
@media (max-width: 540px) {
  .character-dialog :is(.hi-dlg-text, .base-dialog-text, .dialog-text-measure) { font-size: 0.85rem; }
  .character-dialog :is(.hi-dlg-btn, .base-dialog-row button) { min-height: 44px; padding: 8px; font-size: 0.8rem; }
}
@media (max-height: 480px) { .character-dialog :is(.hi-dlg-text, .base-dialog-text, .dialog-text-measure) { font-size: 0.85rem; } }
