.nd-npc-dialog,.nd-npc-preview{box-sizing:border-box;background:#10171f;color:#e8edf3;border:1px solid #c8a95f;border-radius:9px;box-shadow:0 18px 60px #000b;font:15px/1.5 system-ui,sans-serif;text-align:left}
.nd-npc-dialog{position:fixed;inset:0;margin:auto;padding:0;width:min(760px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);overflow:auto}
.nd-npc-dialog::backdrop{background:#000b}.nd-npc-dialog *,.nd-npc-preview *{box-sizing:border-box}
.nd-npc-dialog>header{position:sticky;top:0;z-index:2;background:#10171f;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #c8a95f66}.nd-npc-dialog h3,.nd-npc-preview h3{margin:0 0 8px;font-size:18px;overflow-wrap:anywhere}.nd-npc-dialog>header h3{margin:0}.nd-npc-dialog button{cursor:pointer;background:#17212c;color:#e8edf3;border:1px solid #c8a95f88;border-radius:6px;min-height:44px;padding:8px 12px;font:inherit}.nd-npc-dialog>header button{font-size:24px;flex-shrink:0}.nd-npc-body{padding:18px}.nd-npc-image{display:block;width:100%;height:220px;object-fit:contain;background:#0b1017;border-radius:6px;margin:0 0 14px}.nd-npc-badges{display:flex;flex-wrap:wrap;gap:8px}.nd-npc-reaction{border:1px solid #66717e;border-radius:5px;padding:4px 8px;font-size:13px}.nd-npc-reaction.hostile{color:#ff7474}.nd-npc-reaction.friendly{color:#86df9a}.nd-npc-reaction.neutral{color:#f0d58c}.nd-npc-body dl{display:grid;grid-template-columns:minmax(90px,30%) minmax(0,1fr);gap:7px 12px}.nd-npc-body dt{color:#aeb9c7}.nd-npc-body dd{margin:0;overflow-wrap:anywhere}.nd-npc-note{white-space:pre-wrap}.nd-npc-drops{border-top:1px solid #c8a95f66;margin-top:16px;padding-top:14px}.nd-npc-drops summary{cursor:pointer;color:#c8a95f;min-height:44px}.nd-npc-drop-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.nd-npc-drop-list button{display:flex;align-items:center;gap:8px;text-align:left;min-width:0}.nd-npc-drop-list img{width:30px;height:30px;flex-shrink:0}.nd-npc-drop-list span{overflow-wrap:anywhere}.nd-npc-drop-list small{color:#c8a95f;font-size:11px;margin-left:auto}.nd-npc-body>a{display:inline-block;color:#c8a95f;margin-top:14px}.nd-npc-body label{display:block;margin:10px 0}.nd-npc-body input,.nd-npc-body select{display:block;width:100%;margin-top:5px;padding:10px;background:#17212c;color:#e8edf3;border:1px solid #596676;border-radius:5px;font:inherit}.nd-npc-body>button{margin:6px}.nd-npc-editor-preview{border:1px solid #c8a95f55;border-radius:6px;padding:12px;margin-top:12px}.nd-npc-preview{position:fixed;z-index:2147483002;width:300px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);overflow:auto;padding:12px}.nd-npc-preview .nd-npc-image{height:130px;margin-bottom:8px}.nd-npc-preview p{margin:6px 0;font-size:13px}.nd-npc-dialog :focus-visible{outline:2px solid #c8a95f;outline-offset:3px}@media(max-width:650px){.nd-npc-body{padding:12px}.nd-npc-dialog>header{padding:12px}.nd-npc-image{height:180px}.nd-npc-drop-list{grid-template-columns:minmax(0,1fr)}}

.nd-npc-map{margin:0 0 14px;padding:0;border:1px solid #c8a95f55;border-radius:6px;overflow:hidden;background:#0b1017}.nd-npc-map img{display:block;width:100%;max-height:300px;object-fit:contain}.nd-npc-map figcaption{padding:5px 10px;color:#c8a95f;font-size:12px}.nd-npc-preview{width:360px}.nd-npc-preview .nd-npc-map img{max-height:180px}.nd-npc-preview .nd-npc-image{height:150px}

/* Compact portrait, map gets the available space. */
.nd-npc-dialog{width:min(1100px,calc(100% - 24px));}
.nd-npc-visuals{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:start;gap:16px;}
.nd-npc-visuals:not(:has(.nd-npc-portrait)){grid-template-columns:minmax(0,1fr);}
.nd-npc-portrait{width:150px;}
.nd-npc-portrait .nd-npc-image{width:100%;height:auto;max-height:280px;object-fit:contain;margin:0;background:transparent;}
.nd-npc-visuals .nd-npc-map{width:100%;margin:0;}
.nd-npc-visuals .nd-npc-map img{width:100%;height:auto;max-height:none;cursor:zoom-in;}
.nd-npc-preview{width:850px;}
.nd-npc-preview .nd-npc-visuals{grid-template-columns:110px minmax(0,1fr);gap:12px;}
.nd-npc-preview .nd-npc-portrait{width:110px;}
.nd-npc-preview .nd-npc-image{height:auto;max-height:230px;}
.nd-npc-map-zoom{width:min(1450px,calc(100% - 16px));}
.nd-npc-map-zoom .nd-npc-body img{display:block;width:100%;height:auto;max-height:none;}
@media(max-width:650px){.nd-npc-visuals{grid-template-columns:minmax(0,1fr);gap:12px;}.nd-npc-portrait{width:90px;}.nd-npc-portrait .nd-npc-image{max-height:140px;}.nd-npc-map-zoom .nd-npc-body{overflow:auto;}.nd-npc-map-zoom .nd-npc-body img{width:max(100%,900px);max-width:none;}}
