/* ==========================================================================
   Wiki Module — Complete Restyle with NPC + 3D Relationship Graph
   ========================================================================== */

.wiki-view { display: none; }
.wiki-view.wiki-view-active { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: wikiFadeIn .3s ease forwards; }
@keyframes wikiFadeIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes wikiFadeBack { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
.wiki-view.wiki-view-back { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: wikiFadeBack .3s ease forwards; }

.wiki-search-wrap { margin: 0 16px 16px; position: relative; }
.wiki-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #8e8e93; }
.wiki-search-input { width: 100%; padding: 10px 14px 10px 36px; border: 1px solid #ececec; border-radius: 10px; background: #fff; font-size: 15px; outline: none; color: #1d1d1f; font-family: -apple-system, 'Inter', system-ui, sans-serif; box-sizing: border-box; transition: border-color .2s; }
.wiki-search-input:focus { border-color: #b0b0b0; }

.wiki-section-label { display: flex; align-items: center; gap: 8px; padding: 12px 20px 10px; font-size: 12px; font-weight: 700; color: #8e8e93; text-transform: uppercase; letter-spacing: .6px; }
.wiki-section-label svg { width: 14px; height: 14px; color: #8e8e93; }

.wiki-char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 16px; }
.wiki-char-card { display: flex; flex-direction: column; align-items: center; padding: 20px 8px 16px; background: #fff; border: 1px solid #ececec; border-radius: 16px; cursor: pointer; transition: transform .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.wiki-char-card:active { transform: scale(.96); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.wiki-char-card-avatar { width: 52px; height: 52px; border-radius: 50%; background: #f0f0f5; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; overflow: hidden; flex-shrink: 0; }
.wiki-char-card-avatar svg { width: 24px; height: 24px; color: #b0b0b5; }
.wiki-char-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wiki-char-card-name { font-size: 13px; font-weight: 600; color: #1d1d1f; text-align: center; line-height: 1.3; word-break: break-word; }
.wiki-avatar-letter { font-size: 18px; font-weight: 700; color: #8e8e93; }

.wiki-empty { text-align: center; padding: 60px 20px 40px; color: #8e8e93; }
.wiki-empty svg { width: 52px; height: 52px; color: #d1d1d6; margin-bottom: 14px; }
.wiki-empty p { font-size: 15px; font-weight: 600; color: #636366; margin: 0 0 4px; }
.wiki-empty span { font-size: 13px; color: #b0b0b0; }

.wiki-detail-header { display: flex; flex-direction: column; align-items: center; padding: 8px 16px 20px; }
.wiki-detail-avatar { width: 72px; height: 72px; border-radius: 50%; background: #f0f0f5; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; overflow: hidden; }
.wiki-detail-avatar svg { width: 32px; height: 32px; color: #b0b0b5; }
.wiki-detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wiki-detail-name { font-size: 20px; font-weight: 700; color: #1d1d1f; text-align: center; }

.wiki-detail-tab-bar { display: flex; margin: 0 16px 12px; padding: 3px; background: #e8e8ed; border-radius: 10px; }
.wiki-detail-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 0; border: none; background: transparent; font-size: 13px; font-weight: 600; color: #8e8e93; cursor: pointer; border-radius: 8px; transition: all .25s cubic-bezier(.25,.1,.25,1); -webkit-tap-highlight-color: transparent; user-select: none; font-family: -apple-system, 'Inter', system-ui, sans-serif; }
.wiki-detail-tab svg { width: 14px; height: 14px; }
.wiki-detail-tab.active { background: #fff; color: #1d1d1f; box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.04); }

.wiki-detail-panel { display: none; }
.wiki-detail-panel.wiki-panel-visible { display: block; animation: wikiTabFadeIn .3s ease forwards; }

/* Wiki scoped scrollbar — light grey, unobtrusive */
#screen-wiki .screen-body::-webkit-scrollbar { width: 3px; }
#screen-wiki .screen-body::-webkit-scrollbar-track { background: transparent; }
#screen-wiki .screen-body::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 3px; }
#screen-wiki .screen-body::-webkit-scrollbar-thumb:active { background: #b0b0b5; }
@keyframes wikiTabFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wiki-btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; font-size: 16px; font-weight: 600; cursor: pointer; border-radius: 12px; background: #1d1d1f; color: #fff; font-family: inherit; transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.wiki-btn-primary svg { width: 16px; height: 16px; }
.wiki-btn-primary:active { transform: scale(.98); }

/* Schedule */
.schedule-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.schedule-header-left { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: #1d1d1f; font-family: -apple-system, 'Inter', system-ui, sans-serif; }
.schedule-header-icon { width: 20px; height: 20px; color: #1d1d1f; }
.schedule-add-btn { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; color: #333; cursor: pointer; transition: all .2s; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.schedule-add-btn:active { background: #f0f0f0; transform: scale(.97); }
.schedule-add-btn svg { width: 14px; height: 14px; color: #333; }

.schedule-filter-bar { display: flex; gap: 8px; padding: 8px 20px 12px; }
.schedule-filter { padding: 5px 14px; border: 1px solid #e0e0e0; border-radius: 20px; background: #fff; font-size: 12px; font-weight: 600; color: #8e8e93; cursor: pointer; transition: all .2s; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.schedule-filter.active { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.schedule-filter:active { transform: scale(.96); }

.schedule-timeline { padding: 0 16px; }
.schedule-date-group { margin-bottom: 20px; }
.schedule-date-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #8e8e93; text-transform: uppercase; letter-spacing: .3px; padding: 0 4px 10px; }
.schedule-date-label svg { width: 13px; height: 13px; color: #8e8e93; }
.schedule-items { background: #fff; border-radius: 14px; border: 1px solid #ececec; overflow: hidden; }
.schedule-item { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; transition: background .15s; border-bottom: 1px solid #f2f2f7; -webkit-tap-highlight-color: transparent; }
.schedule-item:last-child { border-bottom: none; }
.schedule-item:active { background: #f8f8f8; }
.schedule-item-indicator { display: flex; flex-direction: column; align-items: center; width: 18px; flex-shrink: 0; padding-top: 3px; }
.schedule-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d1d1d6; background: #fff; cursor: pointer; flex-shrink: 0; transition: all .25s; position: relative; }
.schedule-dot.completed { background: #1d1d1f; border-color: #1d1d1f; }
.schedule-dot.completed::after { content: ''; position: absolute; top: 1.5px; left: 3px; width: 3px; height: 5px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(40deg); }
.schedule-item-line { flex: 1; width: 1.5px; background: #e5e5ea; margin: 6px 0 2px; min-height: 12px; }
.schedule-item:last-child .schedule-item-line { background: transparent; }
.schedule-item-body { flex: 1; min-width: 0; }
.schedule-item-time { font-size: 12px; font-weight: 600; color: #8e8e93; margin-bottom: 2px; display: flex; align-items: center; gap: 4px; }
.schedule-item-time svg { width: 11px; height: 11px; color: #8e8e93; }
.schedule-item-title { font-size: 15px; font-weight: 600; color: #1d1d1f; margin-bottom: 4px; line-height: 1.3; }
.schedule-item.is-completed .schedule-item-title { color: #b0b0b0; text-decoration: line-through; }
.schedule-item-characters { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #636366; margin-bottom: 4px; }
.schedule-item-characters svg { width: 12px; height: 12px; color: #8e8e93; flex-shrink: 0; }
.schedule-item-desc { font-size: 13px; color: #8e8e93; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.schedule-item-more { flex-shrink: 0; align-self: flex-start; margin-top: 2px; padding: 4px; background: none; border: none; cursor: pointer; border-radius: 6px; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.schedule-item-more:active { background: #f0f0f0; }
.schedule-item-more svg { width: 16px; height: 16px; color: #8e8e93; }

.schedule-empty { text-align: center; padding: 50px 20px; color: #8e8e93; }
.schedule-empty svg { width: 48px; height: 48px; color: #d1d1d6; margin-bottom: 12px; }
.schedule-empty p { font-size: 15px; font-weight: 600; color: #636366; margin: 0 0 4px; }
.schedule-empty span { font-size: 13px; color: #b0b0b0; }
.schedule-empty-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 8px 20px; border: 1px solid #e0e0e0; border-radius: 20px; background: #fff; font-size: 13px; font-weight: 600; color: #1d1d1f; cursor: pointer; transition: all .2s; font-family: inherit; }
.schedule-empty-add svg { width: 14px; height: 14px; }
.schedule-empty-add:active { transform: scale(.96); background: #f5f5f5; }

/* Modal */
.wiki-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s; }
.wiki-modal-overlay.active { opacity: 1; pointer-events: auto; }
.wiki-modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.wiki-modal-center { position: relative; width: calc(100% - 48px); max-width: 380px; max-height: 80%; background: #fafafa; border-radius: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; transform: scale(.92); transition: transform .3s cubic-bezier(.32,.72,0,1); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.wiki-modal-overlay.active .wiki-modal-center { transform: scale(1); }
.wiki-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid #ececec; }
.wiki-modal-title { font-size: 16px; font-weight: 700; color: #1d1d1f; }
.wiki-modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: none; background: #e8e8ed; border-radius: 50%; cursor: pointer; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.wiki-modal-close svg { width: 12px; height: 12px; color: #636366; }
.wiki-modal-close:active { background: #d1d1d6; }
.wiki-modal-body { padding: 20px; }
.wiki-modal-footer { display: flex; gap: 10px; padding: 0 20px 20px; }
.wiki-modal-btn-outline { flex: 1; padding: 11px 0; border: 1px solid #d1d1d6; border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; color: #636366; cursor: pointer; font-family: inherit; transition: all .15s; -webkit-tap-highlight-color: transparent; }
.wiki-modal-btn-outline.primary { background: #1d1d1f; border-color: #1d1d1f; color: #fff; }
.wiki-modal-btn-outline:active { transform: scale(.97); }
.wiki-modal-btn-outline:disabled { opacity: .5; pointer-events: none; }

.modal-field { margin-bottom: 20px; }
.modal-field-row { display: flex; gap: 14px; }
.modal-field-label { display: block; font-size: 12px; font-weight: 700; color: #8e8e93; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.modal-field-input { width: 100%; padding: 8px 0; border: none; border-bottom: 1.5px solid #e0e0e0; background: transparent; font-size: 15px; color: #1d1d1f; outline: none; font-family: inherit; transition: border-color .2s; box-sizing: border-box; }
.modal-field-input:focus { border-bottom-color: #1d1d1f; }
.modal-field-textarea { width: 100%; padding: 8px 0; border: none; border-bottom: 1.5px solid #e0e0e0; background: transparent; font-size: 15px; color: #1d1d1f; outline: none; resize: none; font-family: inherit; transition: border-color .2s; box-sizing: border-box; min-height: 60px; }
.modal-field-textarea:focus { border-bottom-color: #1d1d1f; }

.modal-tag-select { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.modal-tag { padding: 5px 12px; border: 1px solid #e0e0e0; border-radius: 16px; background: #fff; font-size: 13px; font-weight: 500; color: #636366; cursor: pointer; transition: all .2s; -webkit-tap-highlight-color: transparent; user-select: none; }
.modal-tag.selected { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.modal-tag:active { transform: scale(.95); }
.modal-tag-empty { font-size: 13px; color: #b0b0b0; padding: 4px 0; }

/* Schedule modal tabs */
.sched-modal-tabs { display: flex; margin: 0 20px 2px; background: #e8e8ed; border-radius: 10px; padding: 3px; gap: 0; }
.sched-modal-tab { flex: 1; padding: 7px 0; border: none; background: transparent; font-size: 13px; font-weight: 600; color: #8e8e93; cursor: pointer; border-radius: 8px; transition: all .22s cubic-bezier(.25,.1,.25,1); font-family: -apple-system, 'Inter', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.sched-modal-tab.active { background: #fff; color: #1d1d1f; box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.04); }
.sched-modal-tab:active { opacity: .75; }

.sched-modal-panel { }

.sched-ai-hint { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; background: #f8f8fa; border-radius: 10px; margin-bottom: 20px; }
.sched-ai-hint svg { width: 16px; height: 16px; color: #8e8e93; flex-shrink: 0; margin-top: 1px; }
.sched-ai-hint span { font-size: 12px; color: #8e8e93; line-height: 1.5; }

.sched-ai-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f8f8fa; border-radius: 10px; font-size: 13px; color: #8e8e93; }
.sched-ai-dots { display: flex; gap: 4px; }
.sched-ai-dots span { width: 6px; height: 6px; border-radius: 50%; background: #b0b0b0; animation: schedAiPulse 1.2s ease-in-out infinite; }
.sched-ai-dots span:nth-child(2) { animation-delay: .2s; }
.sched-ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes schedAiPulse { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

.detail-status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.detail-status-badge.pending { background: #fff; color: #8e8e93; border: 1px solid #e0e0e0; }
.detail-status-badge.completed { background: #1d1d1f; color: #fff; border: 1px solid #1d1d1f; }
.detail-status-badge svg { width: 12px; height: 12px; }
.detail-title { font-size: 20px; font-weight: 700; color: #1d1d1f; margin-bottom: 16px; line-height: 1.3; }
.detail-info-card { background: #fff; border-radius: 12px; border: 1px solid #ececec; overflow: hidden; margin-bottom: 16px; }
.detail-info-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #f2f2f7; }
.detail-info-row:last-child { border-bottom: none; }
.detail-info-row svg { width: 16px; height: 16px; color: #8e8e93; flex-shrink: 0; }
.detail-info-label { font-size: 13px; color: #8e8e93; min-width: 48px; }
.detail-info-value { font-size: 15px; color: #1d1d1f; font-weight: 500; }
.detail-desc-title { font-size: 12px; font-weight: 700; color: #8e8e93; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 8px; }
.detail-desc-body { background: #fff; border-radius: 12px; border: 1px solid #ececec; padding: 14px; font-size: 15px; color: #333; line-height: 1.6; margin-bottom: 16px; }

/* ==========================================================================
   NPC Module
   ========================================================================== */
.npc-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.npc-header-left { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: #1d1d1f; font-family: -apple-system, 'Inter', system-ui, sans-serif; }
.npc-header-icon { width: 20px; height: 20px; color: #1d1d1f; }
.npc-header-add { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; color: #333; cursor: pointer; transition: all .2s; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.npc-header-add:active { background: #f0f0f0; transform: scale(.97); }
.npc-header-add svg { width: 14px; height: 14px; color: #333; }

.npc-list { padding: 0 16px; }
.npc-card { background: #fff; border: 1px solid #ececec; border-radius: 14px; padding: 16px; margin-bottom: 10px; transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.npc-card:active { transform: scale(.98); }
.npc-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.npc-card-avatar { width: 40px; height: 40px; border-radius: 50%; background: #f0f0f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; font-weight: 700; color: #8e8e93; }
.npc-card-info { flex: 1; min-width: 0; }
.npc-card-name { font-size: 15px; font-weight: 700; color: #1d1d1f; line-height: 1.3; }
.npc-card-rel { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 8px; border-radius: 10px; background: #f2f2f7; font-size: 11px; font-weight: 600; color: #636366; }
.npc-card-rel svg { width: 10px; height: 10px; color: #8e8e93; }
.npc-card-del { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 8px; cursor: pointer; transition: background .15s; -webkit-tap-highlight-color: transparent; flex-shrink: 0; }
.npc-card-del:active { background: #f2f2f7; }
.npc-card-del svg { width: 16px; height: 16px; color: #b0b0b0; }
.npc-card-personality { font-size: 13px; color: #636366; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.npc-empty { text-align: center; padding: 50px 20px; color: #8e8e93; }
.npc-empty svg { width: 48px; height: 48px; color: #d1d1d6; margin-bottom: 12px; }
.npc-empty p { font-size: 15px; font-weight: 600; color: #636366; margin: 0 0 4px; }
.npc-empty span { font-size: 13px; color: #b0b0b0; }

.npc-action-group { padding: 8px 0; }
.npc-action-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.npc-action-item:active { background: #f2f2f7; }
.npc-action-item + .npc-action-item { border-top: 1px solid #f2f2f7; }
.npc-action-icon { width: 36px; height: 36px; border-radius: 10px; background: #f2f2f7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.npc-action-icon svg { width: 18px; height: 18px; color: #636366; }
.npc-action-text { flex: 1; min-width: 0; }
.npc-action-label { font-size: 15px; font-weight: 600; color: #1d1d1f; margin-bottom: 2px; }
.npc-action-desc { font-size: 12px; color: #8e8e93; }
.npc-action-arrow { width: 14px; height: 14px; color: #d1d1d6; flex-shrink: 0; }

.npc-gen-hint { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; background: #f8f8fa; border-radius: 10px; margin-top: -4px; }
.npc-gen-hint svg { width: 16px; height: 16px; color: #8e8e93; flex-shrink: 0; margin-top: 1px; }
.npc-gen-hint span { font-size: 12px; color: #8e8e93; line-height: 1.5; }

/* ==========================================================================
   3D Relationship Graph
   ========================================================================== */

.rel-empty { text-align: center; padding: 50px 20px; color: #8e8e93; }
.rel-empty svg { width: 100px; height: 66px; color: #d1d1d6; margin-bottom: 12px; }
.rel-empty p { font-size: 15px; font-weight: 600; color: #636366; margin: 0 0 4px; }
.rel-empty span { font-size: 13px; color: #b0b0b0; }

.rel-graph-container {
	margin: 8px 16px 0;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 2px 16px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.08);
}
.rel-graph-svg {
	width: 100%;
	height: auto;
	display: block;
}

.rel-edge-label {
	font-size: 8px;
	font-weight: 600;
	fill: #8e8e93;
	text-anchor: middle;
	paint-order: stroke;
	stroke: #fff;
	stroke-width: 3px;
	font-family: -apple-system, 'Inter', system-ui, sans-serif;
	pointer-events: none;
}

.rel-center-letter {
	font-size: 17px;
	font-weight: 800;
	fill: #fff;
	text-anchor: middle;
	font-family: -apple-system, 'Inter', system-ui, sans-serif;
	pointer-events: none;
}
.rel-center-name {
	font-size: 10px;
	font-weight: 700;
	fill: #1d1d1f;
	text-anchor: middle;
	font-family: -apple-system, 'Inter', system-ui, sans-serif;
	pointer-events: none;
}

.rel-node-letter {
	font-size: 13px;
	font-weight: 700;
	fill: #fff;
	text-anchor: middle;
	font-family: -apple-system, 'Inter', system-ui, sans-serif;
	pointer-events: none;
}
.rel-node-name {
	font-size: 9px;
	font-weight: 600;
	fill: #636366;
	text-anchor: middle;
	font-family: -apple-system, 'Inter', system-ui, sans-serif;
	pointer-events: none;
}

.rel-node-g { transition: transform .2s ease; }
.rel-node-g:hover { transform: scale(1.15); }
.rel-node-g:hover circle { stroke-width: 3; stroke: #1d1d1f; }
.rel-node-g:active circle { stroke-width: 3.5; }
.rel-center-g { pointer-events: none; }
.rel-tier-0:hover circle { filter: url(#rel-shadow-c); }

.rel-section-label {
	display: flex; align-items: center; gap: 6px;
	padding: 16px 20px 8px;
	font-size: 12px; font-weight: 700; color: #8e8e93;
	text-transform: uppercase; letter-spacing: .5px;
}
.rel-section-label svg { width: 13px; height: 13px; color: #8e8e93; }

.rel-detail-list {
	margin: 0 16px;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	overflow: hidden;
}
.rel-detail-item {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #f2f2f7;
	cursor: pointer;
	transition: background .15s;
	-webkit-tap-highlight-color: transparent;
}
.rel-detail-item:last-child { border-bottom: none; }
.rel-detail-item:active { background: #f8f8f8; }
.rel-detail-avatar {
	width: 36px; height: 36px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0; font-size: 14px; font-weight: 700;
	box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.rel-detail-info { flex: 1; min-width: 0; }
.rel-detail-name { font-size: 15px; font-weight: 600; color: #1d1d1f; line-height: 1.3; }
.rel-detail-type { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; color: #636366; }
.rel-detail-type svg { width: 11px; height: 11px; color: #8e8e93; }

.rel-detail-tier {
	flex-shrink: 0; padding: 2px 8px;
	border-radius: 8px; font-size: 10px; font-weight: 700;
	letter-spacing: .3px; text-transform: uppercase;
}
.rel-detail-tier-0 { background: #555; color: #fff; }
.rel-detail-tier-1 { background: #6e6e73; color: #fff; }
.rel-detail-tier-2 { background: #e8e8ed; color: #636366; }
.rel-detail-tier-3 { background: #f2f2f7; color: #8e8e93; }
.rel-detail-tier-4 { background: #f8f8fa; color: #aeaeb2; }

.rel-hint {
	display: flex; align-items: flex-start; gap: 8px;
	margin: 14px 16px 0; padding: 12px 14px;
	background: #f8f8fa; border-radius: 10px;
}
.rel-hint svg { width: 16px; height: 16px; color: #8e8e93; flex-shrink: 0; margin-top: 1px; }
.rel-hint span { font-size: 12px; color: #8e8e93; line-height: 1.5; }

/* NPC Detail Modal */
.npc-dm-header {
	display: flex; flex-direction: column; align-items: center;
	padding-bottom: 16px; border-bottom: 1px solid #f2f2f7; margin-bottom: 16px;
}
.npc-dm-avatar {
	width: 56px; height: 56px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 22px; font-weight: 800; color: #fff;
	margin-bottom: 10px;
	box-shadow: 0 3px 12px rgba(0,0,0,.15);
}
.npc-dm-name { font-size: 18px; font-weight: 700; color: #1d1d1f; margin-bottom: 6px; }
.npc-dm-tier {
	padding: 3px 10px; border-radius: 10px;
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.npc-dm-tier-0 { background: #555; color: #fff; }
.npc-dm-tier-1 { background: #6e6e73; color: #fff; }
.npc-dm-tier-2 { background: #e8e8ed; color: #636366; }
.npc-dm-tier-3 { background: #f2f2f7; color: #8e8e93; }
.npc-dm-tier-4 { background: #f8f8fa; color: #aeaeb2; }

.npc-dm-fields { }
.npc-dm-field { margin-bottom: 14px; }
.npc-dm-field:last-child { margin-bottom: 0; }
.npc-dm-label {
	display: flex; align-items: center; gap: 6px;
	font-size: 12px; font-weight: 700; color: #8e8e93;
	text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px;
}
.npc-dm-label svg { width: 13px; height: 13px; color: #8e8e93; }
.npc-dm-value { font-size: 15px; color: #1d1d1f; line-height: 1.5; }
