.creature-hub {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  border-radius: 16px;
}

.creature-hub-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.creature-hub-title {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.creature-hub-subtitle {
  font-size: 0.9rem;
  opacity: 0.85;
  margin: 0.25rem 0 0 0;
}

.creature-hub-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.creature-hub-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  overflow-x: auto;
}

.forge-tab {
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.7;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
  white-space: nowrap;
  color: var(--text-primary, #e2e8f0);
}

.forge-tab:hover {
  opacity: 0.9;
}

.forge-tab-active {
  opacity: 1;
  border-bottom-color: var(--color-arcane-teal, #38bdf8);
}

.creature-hub-body {
  margin-top: 0.5rem;
}

.forge-subview {
}

.forge-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.forge-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr);
  gap: 1rem;
}

@media (max-width: 1024px) {
  .forge-body-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.forge-left,
.forge-right {
  background: var(--bg-card, rgba(2, 6, 23, 0.8));
  border-radius: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.35));
}

.forge-left .field-label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
}

.forge-left .field-label:first-child {
  margin-top: 0;
}

.npc-empty {
  text-align: center;
  padding: 2rem 1rem;
  opacity: 0.7;
}

.npc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}

.npc-card {
  background: var(--bg-elevated, rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.npc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.npc-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.npc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.npc-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-arcane-teal, #38bdf8);
  color: var(--bg-primary, #020617);
  border-radius: 9999px;
}

.npc-role-pill.threat-low {
  background: #22c55e;
}

.npc-role-pill.threat-medium {
  background: #eab308;
}

.npc-role-pill.threat-high {
  background: #f97316;
}

.npc-role-pill.threat-boss,
.npc-role-pill.threat-mythic {
  background: #ef4444;
}

.npc-actions-top {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.npc-section {
  margin-top: 0.5rem;
}

.npc-section h5 {
  margin: 0 0 0.25rem 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
}

.npc-summary {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary, #e2e8f0);
}

.npc-advanced-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
}

.link-button {
  background: none;
  border: none;
  color: var(--color-arcane-teal, #38bdf8);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  margin-top: 0.5rem;
}

.link-button:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .creature-hub {
    padding: 0.75rem;
    margin: 0.5rem;
  }

  .creature-hub-header {
    flex-direction: column;
  }

  .creature-hub-context {
    justify-content: flex-start;
  }

  .forge-tab {
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
  }

  .npc-card-header {
    flex-direction: column;
  }

  .npc-actions-top {
    margin-top: 0.5rem;
  }
}

.library-creatures {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  border-radius: 16px;
}

.library-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.library-title {
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-primary, #e2e8f0);
}

.library-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary, #94a3b8);
}

.library-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.library-creature-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.lib-tab {
  background: none;
  border: none;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.7;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
  color: var(--text-primary, #e2e8f0);
}

.lib-tab:hover {
  opacity: 0.9;
}

.lib-tab-active {
  opacity: 1;
  border-bottom-color: var(--color-arcane-teal, #38bdf8);
}

.library-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.library-filters .input-sm {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.35));
  background: var(--bg-input, rgba(15, 23, 42, 0.8));
  color: var(--text-primary, #e2e8f0);
  min-width: 200px;
}

.library-filters .select-sm {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.35));
  background: var(--bg-input, rgba(15, 23, 42, 0.8));
  color: var(--text-primary, #e2e8f0);
}

.library-creature-body {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.npc-card-footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
}

.npc-actions-bottom {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .library-header {
    flex-direction: column;
  }

  .library-context {
    justify-content: flex-start;
  }

  .library-filters {
    flex-direction: column;
  }

  .library-filters .input-sm {
    width: 100%;
    min-width: unset;
  }
}
