/* ── 마을 사람 대화창 ── */
.panel-npc { width: min(480px, 100%); height: min(520px, 100%); }
.panel-npc.is-shop { width: min(640px, 100%); height: min(940px, 100%); }
/* 가게에서 가방을 옆에 띄우면 대화창은 왼쪽으로 비켜 선다(가방은 오른쪽) */
body:has(#panel-inv:not(.hidden)) #panel-npc { justify-content: flex-start; padding-left: 16px; }
body:has(#panel-inv:not(.hidden)) .panel-npc.is-shop { width: min(640px, calc(100vw - var(--cell, 48px) * 10 - 100px)); }
.panel-npc .panel-head h3 { display: flex; align-items: baseline; gap: 8px; }
.npc-title { font-size: 13px; font-weight: 500; color: var(--muted); }
.npc-line {
  flex: none; margin: 0 0 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid #2c2a26; font-size: 15px; line-height: 1.7; color: #f3e6c8;
}
.npc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.npc-note { margin: 0 0 4px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.npc-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(20, 20, 24, 0.6);
}
.npc-row-icon { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.npc-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.npc-row-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npc-row-state { font-size: 12px; color: var(--good); }
.npc-row-state.is-busy { color: var(--muted); }
.npc-step { flex: none; display: flex; gap: 4px; }
.npc-step-btn { min-width: 32px; padding-inline: 0; }
.npc-rift.is-greater { border-color: var(--r5); }
.npc-rift.is-greater .npc-row-name { color: var(--r5); }
.npc-acts { flex: none; display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; margin-top: auto; }
.npc-acts .btn { flex: 1 1 0; min-width: 0; }
/* 가게: 미라의 미확인 물건 · 브론의 재료 변환 */
.shop-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(217, 178, 106, 0.1); border: 1px solid rgba(217, 178, 106, 0.35); }
.shop-coin { width: 30px; height: 30px; object-fit: contain; }
.shop-coin-n { font-weight: 800; color: var(--r5); }
.shop-sec { margin: 8px 0 2px; font-size: 13px; color: var(--accent-2); }
.shop-icon, .cv-icon { object-fit: contain; background: #16151a; padding: 3px; }
.shop-buy { flex: none; min-width: 84px; }
.cv-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cv-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(20, 20, 24, 0.6); color: var(--text); font-size: 12px; font-weight: 700;
}
.cv-chip:hover { border-color: var(--accent); }
.cv-chip.is-on { border-color: var(--accent-2); background: rgba(246, 198, 106, 0.14); color: var(--accent-2); }
.cv-chip-icon { width: 24px; height: 24px; object-fit: contain; flex: none; }
.cv-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-row.is-empty { opacity: 0.5; }
.cv-n { min-width: 28px; text-align: center; font-weight: 800; align-self: center; }
.cv-all { padding-inline: 8px; }
.cv-sum { position: sticky; bottom: 0; margin-top: 4px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--accent); background: var(--panel-2); box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.45); }
.cv-sum-main { font-weight: 800; color: var(--accent-2); }
.cv-sum-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
  .panel-npc { height: auto; max-height: 100%; }
  .npc-rift.is-greater { flex-wrap: wrap; }
  .npc-rift.is-greater .npc-row-info { flex-basis: calc(100% - 54px); }
  .npc-rift.is-greater .npc-step { margin-left: auto; }
  .cv-chips { grid-template-columns: repeat(2, 1fr); }
  .cv-row { flex-wrap: wrap; }
  .cv-row .npc-row-info { flex-basis: calc(100% - 54px); }
  .cv-row .npc-step { margin-left: auto; }
}
