/* 직능 필터 탭 (우측 존재 목록 상단) */
.entity-filter-strip {
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.entity-filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.42);
  color: var(--text-main);
}

.entity-micro-summary {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-micro-summary strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* [ⓘ 상태·장비 시트] 및 직능 전용 행동 바 */
.entity-profile-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.npc-wealth-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: rgba(243, 201, 105, 0.06);
  border: 1px solid rgba(243, 201, 105, 0.18);
  font-size: 11.5px;
  color: var(--text-muted);
}

.npc-wealth-main {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.npc-wealth-main strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.npc-wealth-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.npc-wealth-meta strong {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.npc-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.profile-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.faction-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.faction-meta-line {
  font-size: 11.5px;
  color: var(--text-muted);
}

.faction-meta-line strong {
  color: var(--text-main);
}

.p-metric {
  background: rgba(9, 10, 15, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.p-metric span {
  font-size: 10px;
  color: var(--text-dim);
}

.p-metric strong {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.profile-tags-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.p-tag-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.p-tag-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 34px;
  flex-shrink: 0;
}

.p-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.equip-chip,
.item-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.equip-chip {
  background: rgba(99, 102, 241, 0.13);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-indigo-light);
}

.item-chip {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-main);
}

/* 직능 전용 행동 박스 */
.specialty-actions-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spec-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--accent-gold);
}

.spec-cost-hint {
  color: var(--text-dim);
  font-weight: 500;
}

.spec-action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spec-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-action-info {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  flex: 1;
}

.spec-action-info strong {
  font-size: 12px;
  color: var(--text-main);
}

.spec-action-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.spec-action-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-target-select {
  max-width: 150px;
}

/* [창세 공방] 모달 폼 */
.workshop-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.specialty-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.spec-pick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.spec-pick-card strong {
  font-size: 12.5px;
}

.spec-pick-card span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.spec-pick-card.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--accent-indigo-light);
}

.ws-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ws-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* 수호 성좌 배지 & 생존/존립 단계 UI */
.patron-badge {
  margin-left: auto;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.protag-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.32);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-right: 3px;
}

.status-pill-critical {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.42);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-right: 3px;
}

.status-pill-destroyed {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-right: 3px;
}

.entity-modern-card.card-critical {
  border-color: rgba(244, 63, 94, 0.45);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.07), rgba(19, 22, 32, 0.85));
}

.entity-modern-card.card-destroyed {
  opacity: 0.82;
  border-style: dashed;
}

.patron-status-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
}

.patron-main-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.patron-label {
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 500;
}

.patron-title-badge {
  display: inline-block;
  color: var(--accent-gold);
  font-weight: 650;
  word-break: keep-all;
}

.patron-status-bar.has-patron {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.08);
}

.patron-status-bar strong {
  color: var(--accent-gold);
}

.patron-status-bar em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.35;
}

.lifecycle-alert-box {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lifecycle-alert-box.is-critical {
  background: rgba(244, 63, 94, 0.11);
  border: 1px solid rgba(244, 63, 94, 0.38);
  color: #fecdd3;
}

.lifecycle-alert-box.is-destroyed {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-strong, rgba(255, 255, 255, 0.2));
  color: var(--text-muted);
}

.lc-alert-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.workshop-cost-banner {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: var(--text-main);
  font-size: 11.5px;
  line-height: 1.45;
}

.composer-destroyed {
  padding: 10px 14px;
}

.destroyed-composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.destroyed-composer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.destroyed-composer-text span {
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .specialty-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ws-two-col {
    grid-template-columns: 1fr;
  }
  .npc-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .profile-metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
