.rc-npc-prompt,
.rc-npc-bubble,
.rc-npc-panel {
  box-sizing: border-box;
  color: #f3e9d4;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  text-shadow: none;
}

.rc-npc-prompt {
  position: fixed;
  z-index: 120;
  transform: translate(-50%, -100%);
  max-width: min(280px, 70vw);
  padding: 9px 14px;
  border: 1px solid #d3ab5b;
  border-radius: 12px;
  background: rgba(25, 21, 17, .94);
  box-shadow: 0 8px 25px #0009;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.rc-npc-prompt::after,
.rc-npc-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-right: 1px solid #d3ab5b;
  border-bottom: 1px solid #d3ab5b;
}

.rc-npc-bubble {
  position: fixed;
  z-index: 119;
  transform: translate(-50%, -100%);
  width: max-content;
  max-width: min(330px, 78vw);
  padding: 10px 14px;
  border: 1px solid #d3ab5b;
  border-radius: 14px;
  background: rgba(29, 24, 19, .97);
  box-shadow: 0 8px 24px #000a;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.rc-npc-panel {
  position: fixed;
  z-index: 130;
  top: min(31vh, 270px);
  right: max(22px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(480px, 60vh);
  min-height: 310px;
  border: 1px solid #b7893e;
  border-radius: 16px;
  background: rgba(23, 19, 15, .97);
  box-shadow: 0 18px 52px #000b;
  overflow: hidden;
}

.rc-npc-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid #b7893e80;
  background: linear-gradient(125deg, #682637, #241d17);
}

.rc-npc-heading { display: flex; flex-direction: column; gap: 3px; }
.rc-npc-title { font-size: 19px; }
.rc-npc-subtitle { color: #d7c6a8; font-size: 12px; }
.rc-npc-close {
  border: 0;
  background: transparent;
  color: #f3e9d4;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.rc-npc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  scrollbar-color: #9b7847 transparent;
}
.rc-npc-line { margin-bottom: 13px; max-width: 88%; }
.rc-npc-line--user { margin-left: auto; text-align: right; }
.rc-npc-line-label { color: #d6ae69; font-size: 12px; font-weight: 700; }
.rc-npc-line-text {
  margin: 4px 0 0;
  padding: 9px 11px;
  border: 1px solid #a18257a8;
  border-radius: 12px;
  background: #382b22;
  color: #f7eddb;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.rc-npc-line--user .rc-npc-line-text { background: #4a2d34; }
.rc-npc-status { min-height: 18px; padding: 0 15px 5px; color: #e5bc7b; font-size: 12px; }
.rc-npc-form {
  display: flex;
  gap: 7px;
  padding: 11px;
  border-top: 1px solid #b7893e66;
}
.rc-npc-input {
  flex: 1;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #b7893e;
  border-radius: 9px;
  outline: none;
  background: #28221c;
  color: #f7eddb;
  font-size: 15px;
}
.rc-npc-input::placeholder { color: #bbad93; }
.rc-npc-send {
  padding: 9px 12px;
  border: 1px solid #d3ab5b;
  border-radius: 9px;
  background: #723247;
  color: #fff3de;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.rc-npc-send:disabled { opacity: .5; cursor: wait; }
.rc-npc-panel[hidden], .rc-npc-prompt[hidden], .rc-npc-bubble[hidden] { display: none !important; }

@media (max-width: 700px) {
  .rc-npc-panel {
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    height: min(450px, 65vh);
  }
  .rc-npc-prompt { font-size: 13px; }
}
