/* Conversas compartilham limites próprios, independentemente da janela usada. */
#screen :is(#dialog, #battle.dialogue-scene, #campaign-scene:not(.campaign-large):not(.birch-intro), #cinematic:not(:has(.pvp-field))) {
  position:absolute;
  inset:auto 10px 10px;
  display:block;
  width:auto;
  height:auto;
  min-width:0;
  min-height:0;
  max-width:680px;
  max-height:min(180px,40%);
  margin:0 auto;
  padding:10px 12px;
  box-sizing:border-box;
  overflow:auto;
  overscroll-behavior:contain;
  overflow-wrap:anywhere;
  font:14px/1.4 system-ui,sans-serif;
}
#screen :is(#dialog, #battle.dialogue-scene, #campaign-scene, #cinematic)[hidden] { display:none; }
#screen :is(#battle.dialogue-scene, #campaign-scene:not(.campaign-large):not(.birch-intro), #cinematic:not(:has(.pvp-field))) > p {
  margin:5px 0;
  font:inherit;
  white-space:pre-line;
}
#screen :is(#battle.dialogue-scene, #campaign-scene:not(.campaign-large):not(.birch-intro), #cinematic:not(:has(.pvp-field))) > h3 {
  margin:0 0 5px;
  font:700 13px/1.3 system-ui,sans-serif;
}
@media (pointer:coarse), (max-width:760px), (max-height:600px) and (max-width:1300px) {
  #screen :is(#dialog, #battle.dialogue-scene, #campaign-scene:not(.campaign-large):not(.birch-intro), #cinematic:not(:has(.pvp-field))) {
    inset:auto max(8px,env(safe-area-inset-right)) max(var(--dialog-controls-bottom,160px),env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    max-width:560px;
    max-height:min(170px,34dvh,var(--dialog-available-height,34dvh));
    padding:8px 10px;
    font:13px/1.35 system-ui,sans-serif;
  }
  #screen :is(#dialog, #battle.dialogue-scene, #campaign-scene:not(.campaign-large):not(.birch-intro), #cinematic:not(:has(.pvp-field))) button {
    min-height:36px;
    max-width:100%;
    margin:2px;
    padding:5px 8px;
    font:600 13px/1.2 system-ui,sans-serif;
    white-space:normal;
  }
  #screen #dialog .dialog-choices { display:flex;flex-wrap:wrap;gap:4px; }
}
